Skip to content

test(browser): Fix flaky sessions route-lifecycle test + upgrade axios - #20197

Merged
nicohrubec merged 3 commits into
developfrom
copilot/fix-flaky-playwright-sessions
Apr 22, 2026
Merged

test(browser): Fix flaky sessions route-lifecycle test + upgrade axios#20197
nicohrubec merged 3 commits into
developfrom
copilot/fix-flaky-playwright-sessions

Conversation

CopilotAI commented Apr 10, 2026

Copy link
Copy Markdown
Contributor

The sessions/route-lifecycle Playwright test flakes because getMultipleSentryEnvelopeRequests starts a 4000ms timeout beforepage.goto(). By the time page load + selector wait + 3 sequential clicks complete, the timeout can expire with only 3 of 4 expected init sessions captured.

This PR replaces the timeout-based collection approach with sequential waitForSession calls — the same deterministic pattern already used in start-session, initial-scope, and user session tests:

CopilotAI linked an issue Apr 10, 2026 that may be closed by this pull request
CopilotAIand others added 2 commits April 10, 2026 11:21
…ing timeout-based approach with sequential waitForSession
The test was flaky because getMultipleSentryEnvelopeRequests starts a 4000ms timeout
before page.goto, so the timeout could expire before all 4 session envelopes arrived.
Replaced with the robust sequential waitForSession pattern (used in start-session,
initial-scope, user tests) that deterministically waits for each session individually.
Co-Authored-By: Claude <noreply@anthropic.com>
Agent-Logs-Url: https://github.com/getsentry/sentry-javascript/sessions/443b2c75-cf14-4a37-8212-6a532959da82
Co-authored-by: Lms24 <8420481+Lms24@users.noreply.github.com>
Fixes CVE: Axios NO_PROXY Hostname Normalization Bypass Leads to SSRF.
Co-Authored-By: Claude <noreply@anthropic.com>
Agent-Logs-Url: https://github.com/getsentry/sentry-javascript/sessions/443b2c75-cf14-4a37-8212-6a532959da82
Co-authored-by: Lms24 <8420481+Lms24@users.noreply.github.com>
CopilotAI changed the title [WIP] Fix flaky Playwright ESM sessions after navigationfix(browser-tests): fix flaky sessions route-lifecycle test + upgrade axiosApr 10, 2026
CopilotAI requested a review from Lms24April 10, 2026 11:33
@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 Google GenAI integration by andreiborza in #20184
  • Add enableTruncation option to Anthropic AI integration by andreiborza in #20181
  • Add enableTruncation option to LangGraph integration by andreiborza in #20183
  • Add enableTruncation option to LangChain integration by andreiborza in #20182
  • Add enableTruncation option to OpenAI integration by andreiborza in #20167
  • Export a reusable function to add tracing headers by JPeer264 in #20076

Deps

  • Bump axios from 1.13.5 to 1.15.0 by dependabot in #20180
  • 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 🐛

  • (browser-tests) Fix flaky sessions route-lifecycle test + upgrade axios by Copilot in #20197
  • (deno) Avoid inferring invalid span op from Deno tracer by Lms24 in #20128
  • (e2e) Add op check to waitForTransaction in React Router e2e tests by copilot-swe-agent in #20193

Internal Changes 🔧

Deps

  • Bump hono from 4.12.7 to 4.12.12 in /dev-packages/e2e-tests/test-applications/cloudflare-hono by dependabot in #20119
  • Bump axios from 1.13.5 to 1.15.0 in /dev-packages/e2e-tests/test-applications/nestjs-basic by dependabot in #20179

Other

  • (bugbot) Add rules to flag test-flake-provoking patterns by Lms24 in #20192
  • (deps-dev) Bump vite from 7.2.0 to 7.3.2 in /dev-packages/e2e-tests/test-applications/tanstackstart-react by dependabot in #20107
  • (size-limit) Bump failing size limit scenario by Lms24 in #20186

🤖 This preview updates automatically when you update the PR.

@github-actions

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 Google GenAI integration by andreiborza in #20184
  • Add enableTruncation option to Anthropic AI integration by andreiborza in #20181
  • Add enableTruncation option to LangGraph integration by andreiborza in #20183
  • Add enableTruncation option to LangChain integration by andreiborza in #20182
  • 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 🐛

  • (browser-tests) Fix flaky sessions route-lifecycle test + upgrade axios by Copilot in #20197
  • (deno) Avoid inferring invalid span op from Deno tracer by Lms24 in #20128
  • (e2e) Add op check to waitForTransaction in React Router e2e tests by copilot-swe-agent in #20193

Internal Changes 🔧

  • (bugbot) Add rules to flag test-flake-provoking patterns by Lms24 in #20192
  • (deps) Bump axios from 1.13.5 to 1.15.0 in /dev-packages/e2e-tests/test-applications/nestjs-basic by dependabot in #20179
  • (size-limit) Bump failing size limit scenario by Lms24 in #20186

🤖 This preview updates automatically when you update the PR.

@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--
@sentry/browser - with treeshaking flags24.21 kB--
@sentry/browser (incl. Tracing)42.73 kB--
@sentry/browser (incl. Tracing, Profiling)47.35 kB--
@sentry/browser (incl. Tracing, Replay)81.54 kB--
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags71.11 kB--
@sentry/browser (incl. Tracing, Replay with Canvas)86.25 kB--
@sentry/browser (incl. Tracing, Replay, Feedback)98.45 kB--
@sentry/browser (incl. Feedback)42.51 kB--
@sentry/browser (incl. sendFeedback)30.39 kB--
@sentry/browser (incl. FeedbackAsync)35.38 kB--
@sentry/browser (incl. Metrics)27.04 kB--
@sentry/browser (incl. Logs)27.18 kB--
@sentry/browser (incl. Metrics & Logs)27.86 kB--
@sentry/react27.48 kB--
@sentry/react (incl. Tracing)45.05 kB--
@sentry/vue30.56 kB--
@sentry/vue (incl. Tracing)44.59 kB--
@sentry/svelte25.74 kB--
CDN Bundle28.41 kB--
CDN Bundle (incl. Tracing)43.75 kB--
CDN Bundle (incl. Logs, Metrics)29.78 kB--
CDN Bundle (incl. Tracing, Logs, Metrics)44.83 kB--
CDN Bundle (incl. Replay, Logs, Metrics)68.59 kB--
CDN Bundle (incl. Tracing, Replay)80.64 kB--
CDN Bundle (incl. Tracing, Replay, Logs, Metrics)81.66 kB--
CDN Bundle (incl. Tracing, Replay, Feedback)86.17 kB--
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics)87.2 kB--
CDN Bundle - uncompressed82.99 kB--
CDN Bundle (incl. Tracing) - uncompressed129.77 kB--
CDN Bundle (incl. Logs, Metrics) - uncompressed87.14 kB--
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed133.19 kB--
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed210.12 kB--
CDN Bundle (incl. Tracing, Replay) - uncompressed246.65 kB--
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed250.05 kB--
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed259.56 kB--
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed262.95 kB--
@sentry/nextjs (client)47.47 kB--
@sentry/sveltekit (client)43.2 kB--
@sentry/node-core57.86 kB+0.02%+6 B 🔺
@sentry/node174.83 kB-0.02%-20 B 🔽
@sentry/node - without tracing97.97 kB+0.03%+21 B 🔺
@sentry/aws-serverless115.22 kB+0.02%+19 B 🔺

View base workflow run

@github-actions

Copy link
Copy Markdown
Contributor

node-overhead report 🧳

Note: This is a synthetic benchmark with a minimal express app and does not necessarily reflect the real-world performance impact in an application.
⚠️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.

ScenarioRequests/s% of BaselinePrev. Requests/sChange %
GET Baseline8,929-9,102-2%
GET With Sentry1,74320%1,651+6%
GET With Sentry (error only)5,91966%5,891+0%
POST Baseline1,194-1,157+3%
POST With Sentry59049%561+5%
POST With Sentry (error only)1,04387%1,016+3%
MYSQL Baseline3,216-3,176+1%
MYSQL With Sentry49815%367+36%
MYSQL With Sentry (error only)2,60081%2,593+0%

View base workflow run

@Lms24
Lms24 marked this pull request as ready for review April 10, 2026 13:12
@Lms24
Lms24 requested review from a team, Lms24, chargome and mydea and removed request for a team, Lms24 and chargomeApril 10, 2026 13:12

@Lms24Lms24 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.

lgtm, technically we should split the axios stuff out but I don't care tbh

@Lms24Lms24 changed the title fix(browser-tests): fix flaky sessions route-lifecycle test + upgrade axiostest(browser): Fix flaky sessions route-lifecycle test + upgrade axiosApr 14, 2026
@nicohrubec
nicohrubec merged commit 2798666 into developApr 22, 2026
477 of 480 checks passed
@nicohrubec
nicohrubec deleted the copilot/fix-flaky-playwright-sessions branch April 22, 2026 09:52
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]: Playwright ESM new sessions after navigation

3 participants

@Lms24@nicohrubec