Skip to content

De-flake the HUD end-to-end checks - #54

Merged
KoganTheDev merged 1 commit into
mainfrom
fix/e2e-jog-check
Oct 30, 2026
Merged

KoganTheDev merged 1 commit into
mainfrom
fix/e2e-jog-check

Conversation

@KoganTheDev

Copy link
Copy Markdown
Owner

Why

hud-e2e failed once in CI on #53 (31/32, the jog check), even though #53 didn't touch the HUD or the mock. A rerun passed. Running the harness locally in a loop turned up three separate sources of flakiness.

Flake Rate locally Cause Fix
"hold right arrow jogs the turret" seen in CI read the pan once, right after release; on a slow runner the pose arrives a reply or two later poll for up to 3 s
"record P2 far enough -> saved", "too-close P2: failure shown" about 1 run in 6-12 the mock's target leaves the frame 4 s of every 20 s, so a record could land on a vanished target and count as a miss (neither saved nor failed) new mock flag --stay (always locked, id 1) for the main e2e mock; no check needs the target to leave
all scenarios crash with ConnectionClosedError 1 in 12 on back-to-back runs on Windows a killed Edge's children keep the DevTools port open briefly, so the next run attached to the dying browser wait for the port to be free before launch and after teardown

The P2 check also prints more state if it ever fails again.

Verification

  • 12 consecutive local runs (headless Edge): 12/12 at 32/32.
  • Mock tests OK, including the new test_stay_never_leaves.
  • This PR's CI runs it on Linux Chrome.

- Jog check: poll the pan for up to 3 s instead of reading it once right
  after release (a reply arriving late on a slow runner failed it in CI).
- Calibration checks: the mock's target leaves the frame 4 s of every
  20 s, so a record could land on a vanished target and count as a miss.
  New mock flag --stay keeps the target locked; the main e2e mock uses it.
- Wait for the DevTools port to be free before launching the browser and
  after killing it: on Windows a killed Edge's children can hold the port,
  and the next run attached to the dying browser.
- The P2 check prints more state when it fails.
@github-actions github-actions Bot added the Tools label Oct 30, 2026
@KoganTheDev
KoganTheDev merged commit 0297722 into main Oct 30, 2026
10 checks passed
@KoganTheDev
KoganTheDev deleted the fix/e2e-jog-check branch October 31, 2026 06:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant