test(e2e): Port React Router data router E2E apps to span streaming - #23842
test(e2e): Port React Router data router E2E apps to span streaming#23842andreiborza wants to merge 2 commits into
Conversation
size-limit report 📦
|
450d0d3 to
361c467
Compare
Removes the `traceLifecycle: 'static'` pin from `react-create-browser-router`, `react-create-hash-router` and `react-create-memory-router`, and rewrites their specs against streamed span v2. Two attribute groups moved under streaming and the assertions follow them: the navigator data is now `device.memory.estimated_capacity`, `device.processor_count` and `network.connection.effective_type`, and the pageload timings are `browser.performance.*`. LCP is streamed as its own `ui.webvital.lcp` span once the page hides, so it is no longer asserted on the pageload span.
Streamed spans always carry the common sdk/release/environment and segment attributes on top of what a test names, and a pageload span also carries the web vitals, so the exhaustive attribute match could not hold. Scope the lazy-route resource spans to their own segment's trace, so the initial pageload's bundle scripts cannot satisfy the count.
361c467 to
a0463ab
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit a0463ab. Configure here.
| const childSpans = spans.filter( | ||
| span => !span.is_segment && !(span.attributes['url.full']?.value as string | undefined)?.includes('favicon'), | ||
| ); | ||
| expect(childSpans).toEqual([]); |
There was a problem hiding this comment.
Navigation tests pick the wrong span
Medium Severity
These navigation tests violate the flake-prone wait convention and the relaxed-assertion rule for payloads that must exclude children. waitForStreamedSpans returns one envelope, then spans.find takes the first is_segment span without checking sentry.op. Pageload and navigation can share an envelope, so the wrong segment is selected or leftover children fail the empty-child check; if they flush separately the empty-child assertion never sees the rest of the trace.
Additional Locations (2)
Triggered by project rule: PR Review Guidelines for Cursor Bot
Reviewed by Cursor Bugbot for commit a0463ab. Configure here.


What
Ports
react-create-browser-router,react-create-hash-routerandreact-create-memory-routerto span streaming.Why
Span streaming is the default now, so the E2E suite has to exercise it. Two attribute groups moved and the assertions follow them: the navigator data is now
device.memory.estimated_capacity,device.processor_countandnetwork.connection.effective_type, and the pageload timings arebrowser.performance.*. LCP is streamed as its ownui.webvital.lcpspan once the page hides, so it is no longer asserted on the pageload span.Part of #23798