Skip to content

test(browser): Fix browserTracingIntegration unit test - #20604

Merged
mydea merged 1 commit into
developfrom
fn/fix-browserTracingIntegration-test
Apr 30, 2026
Merged

test(browser): Fix browserTracingIntegration unit test#20604
mydea merged 1 commit into
developfrom
fn/fix-browserTracingIntegration-test

Conversation

@mydea

Copy link
Copy Markdown
Member

After seeing this flake, I looked into this and found this to be fundamentally flawed. The reason being, that while we used fake timers, it turns out that the pageload span logic does not use Date.now() as start date, but instead it uses the browser origin. So depending on how/when the test ran, the timing was actually off and we did not really test what we wanted to. Also, we lacked a unit test for the redirect case here. I added that as well and ensures that this properly tests what we want.

Fixes#20391

@mydeamydea self-assigned this Apr 29, 2026
@mydea
mydea requested a review from a team as a code ownerApril 29, 2026 16:20
@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize% ChangeChange
@sentry/browser26.16 kB--
@sentry/browser - with treeshaking flags24.63 kB--
@sentry/browser (incl. Tracing)44.13 kB--
@sentry/browser (incl. Tracing + Span Streaming)46.34 kB--
@sentry/browser (incl. Tracing, Profiling)49.08 kB--
@sentry/browser (incl. Tracing, Replay)83.48 kB--
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags72.96 kB--
@sentry/browser (incl. Tracing, Replay with Canvas)88.15 kB--
@sentry/browser (incl. Tracing, Replay, Feedback)100.8 kB--
@sentry/browser (incl. Feedback)43.4 kB--
@sentry/browser (incl. sendFeedback)30.96 kB--
@sentry/browser (incl. FeedbackAsync)36.14 kB--
@sentry/browser (incl. Metrics)27.44 kB--
@sentry/browser (incl. Logs)27.59 kB--
@sentry/browser (incl. Metrics & Logs)28.28 kB--
@sentry/react27.9 kB--
@sentry/react (incl. Tracing)46.36 kB--
@sentry/vue31.03 kB--
@sentry/vue (incl. Tracing)45.96 kB--
@sentry/svelte26.18 kB--
CDN Bundle28.85 kB--
CDN Bundle (incl. Tracing)46.91 kB--
CDN Bundle (incl. Logs, Metrics)30.27 kB--
CDN Bundle (incl. Tracing, Logs, Metrics)48.03 kB--
CDN Bundle (incl. Replay, Logs, Metrics)69.35 kB--
CDN Bundle (incl. Tracing, Replay)84.07 kB--
CDN Bundle (incl. Tracing, Replay, Logs, Metrics)85.14 kB--
CDN Bundle (incl. Tracing, Replay, Feedback)89.86 kB--
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics)90.96 kB--
CDN Bundle - uncompressed84.55 kB--
CDN Bundle (incl. Tracing) - uncompressed140.16 kB--
CDN Bundle (incl. Logs, Metrics) - uncompressed88.75 kB--
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed143.62 kB--
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed212.71 kB--
CDN Bundle (incl. Tracing, Replay) - uncompressed257.96 kB--
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed261.41 kB--
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed271.66 kB--
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed275.1 kB--
@sentry/nextjs (client)48.85 kB+0.01%+1 B 🔺
@sentry/sveltekit (client)44.58 kB--
@sentry/node-core59.06 kB+0.02%+9 B 🔺
@sentry/node170.35 kB+0.01%+12 B 🔺
@sentry/node - without tracing96.92 kB+0.01%+8 B 🔺
@sentry/aws-serverless113.78 kB+0.03%+30 B 🔺
@sentry/cloudflare (withSentry) - minified164.96 kB--
@sentry/cloudflare (withSentry)417.1 kB--

View base workflow run

@mydea
mydea merged commit f1af9e1 into developApr 30, 2026
188 checks passed
@mydea
mydea deleted the fn/fix-browserTracingIntegration-test branch April 30, 2026 10:33
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants

@mydea@logaretm