Skip to content

test(e2e): deflake spectrum console-hygiene check against random-track engine noise#56

Merged
indigo423 merged 2 commits into
mainfrom
fix/deflake-spectrum-console-hygiene
Jun 1, 2026
Merged

test(e2e): deflake spectrum console-hygiene check against random-track engine noise#56
indigo423 merged 2 commits into
mainfrom
fix/deflake-spectrum-console-hygiene

Conversation

@indigo423
Copy link
Copy Markdown
Collaborator

What

Extends the console-error allow-filter in e2e/spectrum-analyzer.verify.spec.ts to ignore benign, non-deterministic audio-engine errors from the random track the spec loads.

Why

The spec dismisses the splash via .randombtn, which picks an arbitrary track. Depending on that pick, play() dispatches to an engine that can't decode it, logging:

  • [pcm] 4MEDIA_ERR_SRC_NOT_SUPPORTED from the PCM <audio> element (lib/audio-player.ts:380)
  • [ahx-processor] init failed / wasm_init failed — AHX worklet init (public/ahx.worklet.js)

The test's step 11 console-hygiene assertion (expect(consoleErrors).toEqual([])) then fails — but these errors come from the audio engines reacting to an unlucky track pick, not from the spectrum analyzer under test. This flaked CI on changes that touch neither (e.g. the recent Dependabot Action bumps #51/#53, which both needed playwright re-runs).

Change

One new regex (ENGINE_NOISE_RE = /^\[(pcm|ahx-processor)\]/), applied exactly like the existing RESOURCE_404_RE 404 filter. The assertion still fails loudly on any other console.error or pageerror — including any genuine fault in the spectrum analyzer itself.

🤖 Generated with Claude Code

indigo423 added 2 commits June 1, 2026 12:05
…ne check

The spectrum-analyzer verify spec loads a non-deterministic random track,
whose format may not be decodable by whichever engine play() dispatches to.
That logs benign engine errors — `[pcm] 4` (MEDIA_ERR_SRC_NOT_SUPPORTED) or
an `[ahx-processor]` wasm-init failure — which intermittently tripped the
console-hygiene assertion and failed CI for changes unrelated to the audio
engines (e.g. Dependabot Action bumps).

Filter these the same way as benign resource 404s: they originate from the
audio engines reacting to an unlucky track pick, not from the spectrum
analyzer under test.

Assisted-by: ClaudeCode:claude-opus-4-8
The layout assertion required canvas.x to clear the disc's right edge with
only 1px of slack. The disc gif's intrinsic width plus CI-side flex-row
settling can drift the disc's measured right edge a few px past canvas.x
(observed ~5px on chromium), flaking the check on changes unrelated to
layout.

Widen the slack to 8px, mirroring the generous vertical-center tolerance
documented just below it. The intent is "disc on the left, canvas on the
right", not pixel-perfect non-overlap; a genuine misplacement still fails by
tens of px.

Assisted-by: ClaudeCode:claude-opus-4-8
@indigo423 indigo423 merged commit 06c216d into main Jun 1, 2026
4 checks passed
@indigo423 indigo423 deleted the fix/deflake-spectrum-console-hygiene branch June 1, 2026 10:21
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