Skip to content

fix(test): run the browser lane with motion reduced so the map's WebGL is not starved - #550

Merged
Ardnived merged 1 commit into
mainfrom
fix/navigation-spec-flake
Nov 27, 2026
Merged

Ardnived merged 1 commit into
mainfrom
fix/navigation-spec-flake

Conversation

@Ardnived

Copy link
Copy Markdown
Contributor

Summary

Change outline

Behaviour — why a deep link missed its 5s budget

 deep link to a class (full-map.html?atlas=…/101)
   event JSON arrives ~1s in
   mapbox-gl chunk evaluates → loadMapLib → supported(true)   src/components/organisms/Mapbox/map-lib.ts
     creates a WebGL2 context, compiles a shader (SwiftShader, GPU process)
-    skeleton pulse + spinner spin composite in the same GPU process (animating since #540)
-      → probe blocks the main thread 4–5s in ~half the runs → heading not visible in 5s
+    reducedMotion: 'reduce' (playwright.config.ts) → no animation frames to wait behind
+      → probe ~0.5–1s

Preview

No preview surface: the change is test configuration and docs only.

Test results

  • Lean gate: ✓ lint + typecheck + unit
  • Browser lane, whole lane locally: 38 passed
  • navigation.spec.ts --repeat-each 15 --workers 6 on a loaded machine: 45/45 pass. Before the fix: 8/45 failed.
  • A/B over 3 alternating rounds of 10 deep-link loads (2 workers): main thread blocked > 2.5s in 14/30 without reduced motion, 0/30 with it.

Notes for reviewer

Tiny diff, read inline. Bisected locally: ab2be300 (before #540) had no slow mode, and 05ee47de (#540) has it. #540's keyframe-namespacing fix is what made animate-pulse / animate-spin actually run.

Detail
  • CI history: navigation :60 / :78 never failed before the feat/event-share-inline branch (18:18 on 2026-11-27). Since then they fail in roughly half the runs, merge-queue entries for chore(contracts): re-sync copied contracts from SahajCloud #544 and chore(contracts): re-sync copied contracts from SahajCloud #546 included.
  • The CPU profile of a slow run shows supported() (i in mapbox-gl) at 2–3s. mapbox-gl's own _setupPainter and _finalize slow down the same way, so all GL round trips are contended, not just the probe.
  • Alternatives rejected. Longer expect timeouts would hide a real 5s main-thread stall rather than remove it. Changing the app is unnecessary, because a GPU composites the animation for nothing, and a browser without a GPU fails supported(true) and gets no map.
  • No scenario asserts an animation. A future one can opt back in with page.emulateMedia.

🤖 Generated with Claude Code

…L is not starved

Since #540 the skeleton's pulse and the spinner's turn actually animate. Under
SwiftShader those frames share the GPU process with mapbox-gl's GL calls, so its
supported() probe blocked the main thread for 4-5s in about half of all deep-link
loads, and the navigation scenarios missed their 5s budget in CI. With motion
reduced: 0 of 30 slow loads (14 of 30 without), and 45 of 45 navigation runs pass
under load (8 of 45 failed before).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@sydevs-dispatcher

sydevs-dispatcher Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

🤖 no session running

Written by the sydevs dispatcher. Sessions never edit this comment.

@sydevs-dispatcher sydevs-dispatcher Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved for Ardnived, who wrote it: GitHub refuses an author's own approval. CI is green and the automated review has run. Enable auto-merge when you want it merged: the queue tests it against its base. 🤖 Written by the sydevs autonomous loop — see what this is

@sydevs-dispatcher

Copy link
Copy Markdown
Contributor

Adversarial review skipped: 2 file(s), 15 changed line(s), under review.skipWhen. Say @sydevs-bot review to force one.

🤖 sydevs dispatcher

@sydevs-dispatcher sydevs-dispatcher Bot moved this from Pending to Awaiting in SYDevelopers Technical Roadmap Nov 27, 2026
@Ardnived
Ardnived added this pull request to the merge queue Nov 27, 2026
Merged via the queue into main with commit c23b45c Nov 27, 2026
22 checks passed
@Ardnived
Ardnived deleted the fix/navigation-spec-flake branch November 27, 2026 22:26
@sydevs-dispatcher sydevs-dispatcher Bot moved this from Awaiting to Done in SYDevelopers Technical Roadmap Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

1 participant