Skip to content

Commit 67e0c0c

Browse files
gkorlandCopilot
andcommitted
fix(ci): stop Flask server before uv cache cleanup
The Playwright CI was failing on push events because the background Flask server (started via uv run flask) was never explicitly stopped. The setup-uv action post-job cache pruning step would then hang for 5 minutes waiting on UV cache locks held by the orphan process, failing with exit code 2. Changes: - Separate server startup into its own step with PID capture - Add an always() cleanup step that stops the server before post-job steps run - Keep the test step focused on running Playwright tests only Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent be12eda commit 67e0c0c

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

.github/workflows/playwright.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,17 +81,30 @@ jobs:
8181
npx playwright install chromium firefox
8282
npx playwright install-deps chromium firefox
8383
84-
- name: Run Playwright tests
84+
- name: Start Flask server
85+
id: start-server
8586
env:
8687
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
8788
SECRET_TOKEN: ${{ secrets.SECRET_TOKEN }}
8889
CODE_GRAPH_PUBLIC: "1"
8990
MODEL_NAME: "openai/gpt-4.1-mini"
9091
run: |
9192
uv run flask --app api/index.py run --host 0.0.0.0 --port 5000 &
93+
echo "pid=$!" >> "$GITHUB_OUTPUT"
9294
# Wait for Flask to be ready
9395
timeout 30 bash -c 'until curl -s http://localhost:5000/ > /dev/null 2>&1; do sleep 0.5; done'
94-
npx playwright test --shard=${{ matrix.shard }}/2 --reporter=dot,list
96+
97+
- name: Run Playwright tests
98+
env:
99+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
100+
SECRET_TOKEN: ${{ secrets.SECRET_TOKEN }}
101+
CODE_GRAPH_PUBLIC: "1"
102+
MODEL_NAME: "openai/gpt-4.1-mini"
103+
run: npx playwright test --shard=${{ matrix.shard }}/2 --reporter=dot,list
104+
105+
- name: Stop Flask server
106+
if: always()
107+
run: kill ${{ steps.start-server.outputs.pid }} 2>/dev/null || true
95108

96109
- name: Ensure required directories exist
97110
if: always()

0 commit comments

Comments
 (0)