Skip to content

test(e2e): serve deterministic MOD fixture in clock-advances spec - #65

Merged
indigo423 merged 1 commit into
mainfrom
fix/deflake-clock-advances-deterministic-track
Jun 5, 2026
Merged

test(e2e): serve deterministic MOD fixture in clock-advances spec#65
indigo423 merged 1 commit into
mainfrom
fix/deflake-clock-advances-deterministic-track

Conversation

@indigo423

Copy link
Copy Markdown
Collaborator

Problem

CI run 27039432295 failed: the audio reaches destination after user starts playback spec timed out on chromium and webkit (page.waitForFunction(() => document.title.startsWith("🎶")), 30s).

The spec drove the splash "play random track" path, whose modarchive id is non-deterministic. When the random pick resolves to a non‑libopenmpt format (AHX/PCM route to a different engine), an Invalid‑ID stub, or an otherwise undecodable file, the worklet never decodes → the 🎶 title is never set → the clock stays at 00:00 and the spec times out. This is the same random‑track nondeterminism PR #56 had to paper over for the spectrum spec.

Fix

Intercept api.modarchive.org/downloads.php in the spec and fulfill it with a minimal but audible in‑memory ProTracker (M.K.) module — one looping square‑wave sample retriggered across the pattern. Whatever random id the splash resolves to now yields the same known‑good module, so:

  • decode (🎶 title, clock advances) and
  • audio flow (non‑zero AnalyserNode peak)

both become deterministic, and the external‑network dependency is removed entirely. This mirrors the spectrum spec, which already "sidesteps the need for a real network track fetch."

Verification

Ran locally on all three browser projects:

✓ [chromium] audio reaches destination after user starts playback (3.9s)
✓ [webkit]   audio reaches destination after user starts playback (4.6s)
✓ [firefox]  audio reaches destination after user starts playback (4.6s)

Runtime drops from a 30s timeout to ~4s per browser. npm run typecheck and npm run lint clean (no new warnings).

🤖 Generated with Claude Code

@indigo423
indigo423 force-pushed the fix/deflake-clock-advances-deterministic-track branch from 3b1db99 to 2ee0f67 Compare June 5, 2026 21:27
The "audio reaches destination" spec drove the splash "play random
track" path, whose modarchive id is non-deterministic. When the random
pick resolved to a non-libopenmpt format (AHX/PCM routes to a different
engine), an Invalid-ID stub, or an otherwise undecodable file, the
worklet never decoded, the 🎶 document.title was never set, and the spec
timed out at 30s — failing CI on chromium and webkit for reasons
unrelated to the audio path under test.

Intercept api.modarchive.org/downloads.php and fulfill it with a minimal
but audible in-memory ProTracker ("M.K.") module: one looping square-wave
sample retriggered across the pattern. Whatever random id the splash
resolves to now yields the same known-good module, so both "did it
decode" (🎶 title, clock advances) and "is audio flowing" (non-zero
AnalyserNode peak) become deterministic and the external-network
dependency is removed entirely. Mirrors the spectrum spec, which already
sidesteps the real network track fetch.

Runtime drops from a 30s timeout to ~4s per browser.

Assisted-by: ClaudeCode:claude-opus-4-8
Signed-off-by: Ronny Trommer <ronny@no42.org>
@indigo423
indigo423 force-pushed the fix/deflake-clock-advances-deterministic-track branch from 2ee0f67 to 2c23266 Compare June 5, 2026 21:29
@indigo423
indigo423 enabled auto-merge (squash) June 5, 2026 21:29
@indigo423
indigo423 merged commit 03a49f2 into main Jun 5, 2026
4 checks passed
@indigo423
indigo423 deleted the fix/deflake-clock-advances-deterministic-track branch July 10, 2026 22:53
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