Skip to content

fix(e2e): Add op check to waitForTransaction in React Router e2e tests - #20193

Merged
Lms24 merged 3 commits into
developfrom
copilot/fix-flaky-e2e-react-router-test
Apr 10, 2026
Merged

fix(e2e): Add op check to waitForTransaction in React Router e2e tests#20193
Lms24 merged 3 commits into
developfrom
copilot/fix-flaky-e2e-react-router-test

Conversation

CopilotAI commented Apr 10, 2026

Copy link
Copy Markdown
Contributor
  • Analyze the flaky test issue: waitForTransaction in pageload tests only checks transactionEvent.transaction === '/performance' without verifying op === 'pageload', so it can match navigation transactions in race conditions
  • Fix react-router-7-framework-spa/tests/performance/pageload.client.test.ts - add op === 'pageload' check to all waitForTransaction callbacks
  • Fix react-router-7-framework-spa-node-20-18/tests/performance/pageload.client.test.ts - same fix
  • Fix react-router-7-framework/tests/performance/pageload.client.test.ts - same fix
  • Fix react-router-7-framework-custom/tests/performance/pageload.client.test.ts - same fix
  • Fix react-router-7-framework-node-20-18/tests/performance/pageload.client.test.ts - same fix
  • Fix navigation tests in the same apps to add op === 'navigation' check where missing (prevents symmetric confusion)
  • Run validation (Code Review ✅, CodeQL ✅)
  • Fix formatting issues with yarn format

CopilotAI linked an issue Apr 10, 2026 that may be closed by this pull request
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>
CopilotAI changed the title [WIP] Fix flaky CI for React router e2e testfix(e2e): Add op check to waitForTransaction in React Router e2e testsApr 10, 2026
CopilotAI requested a review from Lms24April 10, 2026 10:16
@Lms24
Lms24 marked this pull request as ready for review April 10, 2026 10:19
@github-actions

github-actionsBot commented Apr 10, 2026

Copy link
Copy Markdown
Contributor

Semver Impact of This PR

🟢 Patch (bug fixes)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

Core

  • Add enableTruncation option to OpenAI integration by andreiborza in #20167
  • Export a reusable function to add tracing headers by JPeer264 in #20076

Deps

  • Bump hono from 4.12.7 to 4.12.12 by dependabot in #20118
  • Bump defu from 6.1.4 to 6.1.6 by dependabot in #20104

Bug Fixes 🐛

  • (e2e) Add op check to waitForTransaction in React Router e2e tests by Copilot in #20193

Internal Changes 🔧

  • (bugbot) Add rules to flag test-flake-provoking patterns by Lms24 in #20192
  • (size-limit) Bump failing size limit scenario by Lms24 in #20186

🤖 This preview updates automatically when you update the PR.

@Lms24
Lms24 requested review from a team, JPeer264, andreiborza and stephanie-anderson and removed request for a team and stephanie-andersonApril 10, 2026 10:20
@Lms24

Copy link
Copy Markdown
Member

@copilot run yarn format to fix the formatting issues

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>

CopilotAI commented Apr 10, 2026

Copy link
Copy Markdown
ContributorAuthor

@copilot run yarn format to fix the formatting issues

Fixed in 53e3ef0 — ran oxfmt to break long lines in the 5 pageload test files.

CopilotAI requested a review from Lms24April 10, 2026 10:24

@nicohrubecnicohrubec left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

thanks!

@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

⚠️Warning: Base artifact is not the latest one, because the latest workflow run is not done yet. This may lead to incorrect results. Try to re-run all tests to get up to date results.

PathSize% ChangeChange
@sentry/browser25.72 kB+0.31%+77 B 🔺
@sentry/browser - with treeshaking flags24.21 kB+0.34%+82 B 🔺
@sentry/browser (incl. Tracing)42.73 kB+1.36%+573 B 🔺
@sentry/browser (incl. Tracing, Profiling)47.35 kB+1.25%+583 B 🔺
@sentry/browser (incl. Tracing, Replay)81.54 kB+0.75%+600 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags71.11 kB+0.78%+549 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas)86.25 kB+0.7%+594 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback)98.45 kB+0.56%+541 B 🔺
@sentry/browser (incl. Feedback)42.51 kB+0.21%+87 B 🔺
@sentry/browser (incl. sendFeedback)30.39 kB+0.27%+80 B 🔺
@sentry/browser (incl. FeedbackAsync)35.38 kB+0.24%+82 B 🔺
@sentry/browser (incl. Metrics)27.04 kB+0.31%+83 B 🔺
@sentry/browser (incl. Logs)27.18 kB+0.3%+81 B 🔺
@sentry/browser (incl. Metrics & Logs)27.86 kB+0.29%+80 B 🔺
@sentry/react27.48 kB+0.26%+71 B 🔺
@sentry/react (incl. Tracing)45.05 kB+1.28%+566 B 🔺
@sentry/vue30.56 kB+1.61%+483 B 🔺
@sentry/vue (incl. Tracing)44.59 kB+1.23%+538 B 🔺
@sentry/svelte25.74 kB+0.31%+77 B 🔺
CDN Bundle28.41 kB+0.3%+83 B 🔺
CDN Bundle (incl. Tracing)43.75 kB+1.46%+628 B 🔺
CDN Bundle (incl. Logs, Metrics)29.78 kB+0.31%+92 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics)44.83 kB+1.5%+660 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics)68.59 kB+0.16%+103 B 🔺
CDN Bundle (incl. Tracing, Replay)80.64 kB+0.78%+621 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics)81.66 kB+0.75%+604 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback)86.17 kB+0.72%+615 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics)87.2 kB+0.71%+610 B 🔺
CDN Bundle - uncompressed82.99 kB+0.34%+279 B 🔺
CDN Bundle (incl. Tracing) - uncompressed129.77 kB+1.5%+1.92 kB 🔺
CDN Bundle (incl. Logs, Metrics) - uncompressed87.14 kB+0.33%+279 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed133.19 kB+1.46%+1.92 kB 🔺
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed210.12 kB+0.14%+279 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed246.65 kB+0.79%+1.92 kB 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed250.05 kB+0.78%+1.92 kB 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed259.56 kB+0.75%+1.92 kB 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed262.95 kB+0.74%+1.92 kB 🔺
@sentry/nextjs (client)47.47 kB+1.24%+579 B 🔺
@sentry/sveltekit (client)43.2 kB+1.36%+577 B 🔺
@sentry/node-core57.86 kB+3.78%+2.1 kB 🔺
@sentry/node174.83 kB+1.42%+2.43 kB 🔺
@sentry/node - without tracing97.97 kB+2.02%+1.94 kB 🔺
@sentry/aws-serverless115.22 kB+2.11%+2.38 kB 🔺

View base workflow run

@Lms24
Lms24 merged commit 45d624f into developApr 10, 2026
44 checks passed
@Lms24
Lms24 deleted the copilot/fix-flaky-e2e-react-router-test branch April 10, 2026 10:50
Sign up for freeto 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]: React router e2e test

3 participants

@Lms24@nicohrubec