From abd4a7f0f876340709f18c627accd7911e332e81 Mon Sep 17 00:00:00 2001 From: adilallo <39313955+adilallo@users.noreply.github.com> Date: Sun, 14 Sep 2025 12:44:50 -0600 Subject: [PATCH] Update CI memory allocation --- .gitea/workflows/ci.yaml | 75 ++++++++++++++++++++++++++++++++++------ .runner.pid | 2 +- 2 files changed, 65 insertions(+), 12 deletions(-) diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index 2bea038..484e03c 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -93,7 +93,7 @@ jobs: env: NEXT_TELEMETRY_DISABLED: "1" NODE_ENV: production - NODE_OPTIONS: "--max-old-space-size=4096" + NODE_OPTIONS: "--max-old-space-size=8192" # package artifacts (keeps file count small) - name: Package E2E artifacts @@ -149,31 +149,84 @@ jobs: echo "$SVPID" > .next/runner.pid echo "๐ŸŒ Server PID: $SVPID" - # Wait for readiness + # Wait for readiness with better error handling echo "โณ Waiting for server to be ready..." npx wait-on -t 120000 "tcp:$HOST:$PORT" - curl -fsS "http://$HOST:$PORT" >/dev/null - echo "โœ… App is responding at http://$HOST:$PORT" + # Verify server is actually responding + for i in {1..10}; do + if curl -fsS "http://$HOST:$PORT" >/dev/null 2>&1; then + echo "โœ… App is responding at http://$HOST:$PORT" + break + else + echo "โณ Attempt $i/10: Server not ready yet, waiting..." + sleep 5 + if [ $i -eq 10 ]; then + echo "โŒ Server failed to respond after 10 attempts" + echo "๐Ÿ“‹ Server logs:" + cat .next/runner.log || true + exit 1 + fi + fi + done - - # Run visual regression tests + # Run visual regression tests with server monitoring echo "๐Ÿงช Running visual regression tests..." - BASE_URL="http://$HOST:$PORT" npx playwright test tests/e2e/visual-regression.spec.ts - # Teardown + # Start server health monitoring in background + ( + while true; do + if ! curl -fsS "http://$HOST:$PORT" >/dev/null 2>&1; then + echo "โš ๏ธ Server health check failed - server may have crashed" + echo "๐Ÿ“‹ Current server logs:" + tail -20 .next/runner.log || true + break + fi + sleep 10 + done + ) & + HEALTH_PID=$! + + # Run tests with increased timeout for CI stability + BASE_URL="http://$HOST:$PORT" npx playwright test tests/e2e/visual-regression.spec.ts --timeout=120000 + + # Stop health monitoring + kill $HEALTH_PID 2>/dev/null || true + + # Teardown with better error handling echo "๐Ÿงน Cleaning up server..." kill "$SVPID" 2>/dev/null || true + + # Wait for server to actually stop + for i in {1..10}; do + if ! kill -0 "$SVPID" 2>/dev/null; then + echo "โœ… Server process stopped" + break + else + echo "โณ Waiting for server to stop... ($i/10)" + sleep 2 + if [ $i -eq 10 ]; then + echo "โš ๏ธ Force killing server process" + kill -9 "$SVPID" 2>/dev/null || true + fi + fi + done + echo "โœ… Server cleanup complete" env: NEXT_TELEMETRY_DISABLED: "1" NODE_ENV: production - NODE_OPTIONS: "--max-old-space-size=4096" + NODE_OPTIONS: "--max-old-space-size=8192" - name: Package visual artifacts if: always() run: | - tar -czf visual-regression.tgz test-results tests/e2e/visual-regression.spec.ts-snapshots || true + # Include server logs for debugging + echo "๐Ÿ“‹ Server logs for debugging:" + cat .next/runner.log || echo "No server logs found" + + # Package test results and logs + tar -czf visual-regression.tgz test-results tests/e2e/visual-regression.spec.ts-snapshots .next/runner.log || true - name: Upload visual artifacts if: always() @@ -325,7 +378,7 @@ jobs: env: NEXT_TELEMETRY_DISABLED: "1" NODE_ENV: production - NODE_OPTIONS: "--max-old-space-size=4096" + NODE_OPTIONS: "--max-old-space-size=8192" - name: Upload LHCI results if: always() diff --git a/.runner.pid b/.runner.pid index 9e873f2..e1d5c86 100644 --- a/.runner.pid +++ b/.runner.pid @@ -1 +1 @@ -68063 +64286