Skip to content

test(e2e): the drag test samples the hand's start at mousedown (T-104) - #94

Merged
CLYEH merged 1 commit into
developfrom
fix/qa-t104-drag-test-race
Sep 2, 2026
Merged

CLYEH merged 1 commit into
developfrom
fix/qa-t104-drag-test-race

Conversation

@CLYEH

@CLYEH CLYEH commented Sep 2, 2026

Copy link
Copy Markdown
Owner

The T-104 drag test measured the flight, not the hand

e2e/awakening-flight.spec.ts's fourth test sampled the live camera before mouse.down() while the flight was still in the air, then compared the post-drag camera against it. On CI (run 33586396145, the first check of PR #93) the flight's own motion between the sample and the mousedown ran opposite to the 160×120 px pan and cancelled most of it: dragDelta read 0.00055 against the 0.001 floor. The same test passed CI on PR #92 by timing.

The fix (spec only)

  • Sample beforeDrag right after mouse.down(). MapLibre's pan handler is activateOnStart, so the mousedown alone makes the handler manager call stop(true) (maplibre-gl-dev.mjs:21620) and the camera is frozen until the first pan delta — the sample now isolates the hand's effect exactly.
  • Replace the fixed 400 ms inertia wait with waitForFunction(() => !map.isMoving()), so the moveend the store publishes on has fired before the position is read.

No product code changes.

How verified

  • pnpm exec playwright test e2e/awakening-flight.spec.ts --workers=2 --repeat-each=3: 12 passed, 0 skipped.
  • pnpm exec eslint e2e/awakening-flight.spec.ts, pnpm exec tsc --noEmit: clean.
  • Honest note: a --repeat-each=5 run with the default worker count pushed this machine's load average above 150 and timed out three of the spec's tests (including two this PR does not touch, at the 30 s test timeout). That is the runner, not the change — the rerun at 2 workers on a settled machine was fully green — but it is a reminder that every flight test here has a ~2 s animation with a 6 s arrival budget.

Task: T-104

The fourth T-104 test compared the post-drag camera against a live sample
taken BEFORE `mouse.down()`, while the flight was still moving. On a slow
runner the flight's own motion between that sample and the mousedown ran
opposite to the 160x120px pan and cancelled most of it: CI read 0.00055
against the 0.001 floor (run 33586396145, PR #93). The pan handler is
`activateOnStart`, so the mousedown itself calls `stop(true)` and freezes
the camera; sampling right after it isolates the hand's effect exactly.

The fixed 400 ms inertia wait is now a poll on `!map.isMoving()`, so the
`moveend` the store publishes on has fired before the position is read.

Verified: 12/12 with `--workers=2 --repeat-each=3`; under a load average
above 150 (a parallel `--repeat-each=5` on this machine) the spec's other
tests also timed out, which is the runner, not the change.

Task: T-104
@vercel

vercel Bot commented Sep 2, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
glassmap Ready Ready Preview Sep 2, 2026 3:32am UTC

@CLYEH
CLYEH merged commit facda4a into develop Sep 2, 2026
3 checks passed
@CLYEH
CLYEH deleted the fix/qa-t104-drag-test-race branch September 2, 2026 03:36

This branch was successfully deployed

1 active deployment
Preview — f0ee6ee9 Deployed Sep 2, 2026 by vercel[bot]
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