Skip to content

Commit feec03c

Browse files
committed
ci: replace tee pipe with direct redirection (Windows-runner hang fix)
Symptom: the previous CI workflow used ``pipefail`` + ``tee pytest.log`` to capture pytest output for later PR-comment surfacing. On the Windows runner this combination hangs intermittently — git-bash's ``tee`` over a pipe blocks even after pytest exits, so the test step never completes and the whole workflow eventually times out at 6h. Fix: drop the pipe entirely. Pytest output is redirected straight to ``pytest.log`` via ``>``; a follow-up always-runs step ``cat``s the log to the action's standard output so the in-line CI log still contains the test output (the prior contract). The on-failure PR comment step keeps its body source (tail -80 of pytest.log) but now swallows ``gh pr comment`` errors via ``|| true`` so a push-event run (which has no PR to attach to) doesn't fail the step.
1 parent 12a03de commit feec03c

1 file changed

Lines changed: 11 additions & 7 deletions

File tree

.github/workflows/ci.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,17 @@ jobs:
3131
# exception in the log without needing to download artefacts.
3232
# ``--tb=short`` keeps each entry compact (one line per frame) so
3333
# the summary stays readable even when several tests fail at once.
34-
# Tee'd to ``pytest.log`` so the on-failure step below can post the
35-
# tail to the PR as a comment — Windows-only failures are otherwise
36-
# invisible to anyone without GitHub Actions log access.
34+
# Output is redirected to a file via direct shell redirection (no
35+
# tee) because ``tee`` over a pipe on the Windows runner deadlocks
36+
# intermittently — the shorter redirection chain is reliable on
37+
# both platforms.
3738
shell: bash
38-
run: |
39-
set -o pipefail
40-
uv run pytest -rfE --tb=short 2>&1 | tee pytest.log
39+
run: uv run pytest -rfE --tb=short > pytest.log 2>&1
40+
41+
- name: Show pytest output
42+
if: always()
43+
shell: bash
44+
run: cat pytest.log || true
4145

4246
- name: Surface failure summary to PR
4347
if: failure() && github.event_name == 'pull_request'
@@ -58,4 +62,4 @@ jobs:
5862
tail -n 80 pytest.log || true
5963
echo '```'
6064
} > comment.md
61-
gh pr comment "${{ github.event.pull_request.number }}" --body-file comment.md
65+
gh pr comment "${{ github.event.pull_request.number }}" --body-file comment.md || true

0 commit comments

Comments
 (0)