fix(e2e): Add op check to waitForTransaction in React Router e2e tests#20193
Merged
fix(e2e): Add op check to waitForTransaction in React Router e2e tests#20193
Conversation
Add `transactionEvent.contexts?.trace?.op` checks to all `waitForTransaction` callbacks in React Router e2e performance tests. Previously, the callbacks only checked the transaction name (e.g., `transactionEvent.transaction === '/performance'`), which could match either a pageload or navigation transaction in race conditions. This caused the flaky test failure where a navigation transaction was captured instead of the expected pageload transaction. Pageload tests now include `&& transactionEvent.contexts?.trace?.op === 'pageload'` and navigation tests include `&& transactionEvent.contexts?.trace?.op === 'navigation'`. This follows the pattern already used in `react-router-7-framework-instrumentation` tests. Co-Authored-By: Claude <noreply@anthropic.com> Agent-Logs-Url: https://github.com/getsentry/sentry-javascript/sessions/b44f977f-b777-4975-9077-230d435aed7f Co-authored-by: Lms24 <8420481+Lms24@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix flaky CI for React router e2e test
fix(e2e): Add op check to waitForTransaction in React Router e2e tests
Apr 10, 2026
Lms24
approved these changes
Apr 10, 2026
Contributor
Semver Impact of This PR🟢 Patch (bug fixes) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨Core
Deps
Bug Fixes 🐛
Internal Changes 🔧
🤖 This preview updates automatically when you update the PR. |
Member
|
@copilot run |
Co-Authored-By: Claude <noreply@anthropic.com> Agent-Logs-Url: https://github.com/getsentry/sentry-javascript/sessions/3dbdda00-7418-4246-9c57-5cd8a42ee84e Co-authored-by: Lms24 <8420481+Lms24@users.noreply.github.com>
Contributor
Author
Fixed in 53e3ef0 — ran |
Lms24
approved these changes
Apr 10, 2026
Contributor
size-limit report 📦
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
waitForTransactionin pageload tests only checkstransactionEvent.transaction === '/performance'without verifyingop === 'pageload', so it can match navigation transactions in race conditionsreact-router-7-framework-spa/tests/performance/pageload.client.test.ts- addop === 'pageload'check to allwaitForTransactioncallbacksreact-router-7-framework-spa-node-20-18/tests/performance/pageload.client.test.ts- same fixreact-router-7-framework/tests/performance/pageload.client.test.ts- same fixreact-router-7-framework-custom/tests/performance/pageload.client.test.ts- same fixreact-router-7-framework-node-20-18/tests/performance/pageload.client.test.ts- same fixop === 'navigation'check where missing (prevents symmetric confusion)yarn format