Skip to content

test(peaks): wait for the spawn, not a fixed tick (flaky on CI) - #421

Merged
Maxaubert merged 1 commit into
mainfrom
test/peaks-jobs-wait
Oct 16, 2026
Merged

Maxaubert merged 1 commit into
mainfrom
test/peaks-jobs-wait

Conversation

@Maxaubert

Copy link
Copy Markdown
Owner

Bug

peaksJobs.test.ts (new in #420) failed on main's ci run after #420 merged, though it passed in the PR check and locally.

  • A waveform job spawns ffmpeg only after its real stat (the cache key) answers.
  • The tests waited a fixed 5 ms tick and then expected the spawn. On a busy runner the stat took longer, so "keeps a cancel..." saw no process.
  • Its leftover job then held the head of the one-at-a-time queue, so the next test's finish(procs[0]) finished the wrong job and timed out at 5 s.

Fix

Test-only: spawned(n) waits for the spawn with vi.waitFor (4 s cap) where the tests used to tick and hope. The app code is unchanged.

Proof

  • Reproduced with stat mocked to answer after 30 ms: all 4 tests fail before the fix and pass after.
  • 3 repeat runs pass; lint and typecheck clean.
  • No e2e: no app code changed. No version bump: nothing ships.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DzqPzR6LuAvhiDabNwqzpx

…CI cannot fail the waveform jobs

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DzqPzR6LuAvhiDabNwqzpx
@Maxaubert
Maxaubert merged commit 88bb8f2 into main Oct 16, 2026
2 checks passed
@Maxaubert
Maxaubert deleted the test/peaks-jobs-wait branch October 16, 2026 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant