fix(browser-tests): fix flaky sessions route-lifecycle test + upgrade axios#20197
fix(browser-tests): fix flaky sessions route-lifecycle test + upgrade axios#20197
Conversation
…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>
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 🔧Deps
Other
🤖 This preview updates automatically when you update the PR. |
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. |
size-limit report 📦
|
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.
|
The
sessions/route-lifecyclePlaywright test flakes becausegetMultipleSentryEnvelopeRequestsstarts 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 expectedinitsessions captured.This PR replaces the timeout-based collection approach with sequential
waitForSessioncalls — the same deterministic pattern already used instart-session,initial-scope, andusersession tests: