From f96dd330b37eb7ffcf95e1ba50715fce9a7ea614 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Sat, 18 Oct 2025 11:16:26 +0100 Subject: [PATCH] [Test] Stop containers before checking ASAN logs 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 | 43 +++++++++++++------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml index 9c9f9ae245..3393d12184 100644 --- a/.github/workflows/integration-test.yml +++ b/.github/workflows/integration-test.yml @@ -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: | -- 2.47.3