]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Test] Stop containers before checking ASAN logs 5688/head
authorVsevolod Stakhov <vsevolod@rspamd.com>
Sat, 18 Oct 2025 10:16:26 +0000 (11:16 +0100)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Sat, 18 Oct 2025 10:16:26 +0000 (11:16 +0100)
ASAN logs are written only when processes terminate, not during runtime.
Need to stop Docker containers first to flush ASAN logs, then check them.

Order of steps:
1. Run integration test
2. Collect Docker logs (while running)
3. Stop Docker Compose (triggers ASAN log flush)
4. Check AddressSanitizer logs (now available)
5. Upload artifacts

.github/workflows/integration-test.yml

index 9c9f9ae245618b655a0fc6fb50c85ff77328d213..3393d121846f3b6f75938c8fad1782c9bd0c8f1a 100644 (file)
@@ -268,25 +268,36 @@ jobs:
 
           ./scripts/integration-test.sh
 
-      - name: Check AddressSanitizer logs
+      - name: Collect Docker logs
         if: always()
         working-directory: test/integration
         run: |
-          # Debug: Check if ASAN environment is set in container
-          echo "=== Checking ASAN configuration in container ==="
-          docker compose exec -T rspamd sh -c 'echo ASAN_OPTIONS=$ASAN_OPTIONS; echo LSAN_OPTIONS=$LSAN_OPTIONS'
+          docker compose logs > docker-compose-logs.txt
 
-          # Debug: Check what files exist in /data
-          echo "=== Files in /data inside container ==="
-          docker compose exec -T rspamd ls -la /data/
+      - name: Stop Docker Compose
+        if: always()
+        working-directory: test/integration
+        run: |
+          echo "Stopping containers to trigger ASAN log flush..."
+          docker compose down -v
 
-          # Debug: Check what files exist in data on host
-          echo "=== Files in data/ on host ==="
+      - name: Check AddressSanitizer logs
+        if: always()
+        working-directory: test/integration
+        run: |
+          echo "=== Checking for ASAN logs after container shutdown ==="
           ls -la data/
 
           # Fix permissions on ASAN logs created by Docker
           sudo chmod -R 644 data/asan.log* 2>/dev/null || true
-          ./scripts/check-asan-logs.sh || echo "Memory issues detected, but continuing..."
+
+          # Check if ASAN logs exist
+          if ls data/asan.log* 1> /dev/null 2>&1; then
+            echo "✓ ASAN logs found"
+            ./scripts/check-asan-logs.sh || echo "Memory issues detected, but continuing..."
+          else
+            echo "⚠ No ASAN logs found after container shutdown"
+          fi
 
       - name: Upload results
         if: always()
@@ -300,12 +311,6 @@ jobs:
             test/integration/data/*.log
           retention-days: 7
 
-      - name: Collect Docker logs
-        if: always()
-        working-directory: test/integration
-        run: |
-          docker compose logs > docker-compose-logs.txt
-
       - name: Upload Docker logs
         if: always()
         uses: actions/upload-artifact@v4
@@ -316,12 +321,6 @@ jobs:
           retention-days: 7
         continue-on-error: true
 
-      - name: Stop Docker Compose
-        if: always()
-        working-directory: test/integration
-        run: |
-          docker compose down -v
-
       - name: Test summary
         if: always()
         run: |