Skip to content

test(remix-hydrogen): Fix flaky navigation transaction test#21535

Merged
mydea merged 1 commit into
developfrom
fix/remix-hydrogen-navigation-flake
Jun 15, 2026
Merged

test(remix-hydrogen): Fix flaky navigation transaction test#21535
mydea merged 1 commit into
developfrom
fix/remix-hydrogen-navigation-flake

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Summary

Fixes the flaky [chromium] › tests/client-transactions.test.ts:16:1 › Sends a navigation transaction to Sentry E2E test in the remix-hydrogen test application.

Root cause

The test does page.goto('/') and then immediately clicks the #navigation <Link>, expecting a client-side navigation transaction to /user/:id.

If Remix has not finished hydrating when the click fires, the <Link> behaves like a plain <a href="/user/5"> and the browser performs a full page navigation. That produces a pageload transaction for /user/:id rather than a navigation transaction. Since the test only resolves on op === 'navigation', the waitForTransaction promise never settles and the test times out — the source of the flake.

Fix

Wait for the initial pageload transaction (op === 'pageload', transaction === '/') to be sent before clicking the link. By the time that transaction is emitted, the client SDK and Remix router are hydrated, so the click reliably produces a client-side navigation transaction. This mirrors the existing pageloadPromise pattern already used in react-router-7-lazy-routes/tests/transactions.test.ts.

All existing assertions are preserved unchanged.

Fixes #21198

…ransaction test

Fixes #21198

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mydea mydea enabled auto-merge (squash) June 15, 2026 12:45
@mydea mydea merged commit f331c06 into develop Jun 15, 2026
43 checks passed
@mydea mydea deleted the fix/remix-hydrogen-navigation-flake branch June 15, 2026 13:17
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.

[Flaky CI]: E2E remix-hydrogen Test - [chromium] › tests/client-transactions.test.ts:16:1 › Sends a navigation transaction to Sentry

1 participant