test(e2e): Port the React Router lazy routes E2E app to span streaming - #23846
test(e2e): Port the React Router lazy routes E2E app to span streaming#23846andreiborza wants to merge 2 commits into
Conversation
size-limit report 📦
|
2cc3dfd to
9083cbf
Compare
9083cbf to
ea78db3
Compare
ea78db3 to
797611d
Compare
797611d to
2460015
Compare
e5246b4 to
aa2cbfc
Compare
Removes the `traceLifecycle: 'static'` pin from `react-router-7-lazy-routes` and rewrites its specs against streamed span v2. The span-leaking and GQL attribution specs group streamed spans by trace instead of reading a transaction's `spans` array, and they match fetch spans on `url.full`, since a streamed `http.client` span carries only the domain in its name.
The pageload span was also taken from the first segment in the collection rather than the one the wait matched.
aa2cbfc to
cd0da76
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit cd0da76. Configure here.
|
|
||
| // Verify the trace contains a fetch span. Streamed http.client names are only `<METHOD> <domain>`, | ||
| // so the request URL comes from `url.full`. | ||
| const fetchSpan = spans.find(span => getSpanOp(span) === 'http.client' && hasUrlPart(span, '/api/slow-data')); |
There was a problem hiding this comment.
Child fetch spans not awaited
Medium Severity
collectStreamedTrace and collectStreamedSpans stop once the segment arrives, then the tests immediately assert on fetch children. Streamed children can flush after their segment, so the UserA/UserB and /api/slow-data checks can miss spans that the old transaction payload always included.
Additional Locations (2)
Triggered by project rule: PR Review Guidelines for Cursor Bot
Reviewed by Cursor Bugbot for commit cd0da76. Configure here.
| // Monitor and add all transaction names sent to Sentry for the navigations | ||
| const allTransactionsPromise = waitForTransaction('react-router-7-lazy-routes', async transactionEvent => { | ||
| if (transactionEvent?.transaction) { | ||
| transactionNamesList.push(transactionEvent.transaction); |
There was a problem hiding this comment.
Collector records every segment span
Low Severity
The duplicate-name spec now pushes every is_segment span into transactionNamesList and expects exactly five route names. waitForTransaction only ever saw pageload and navigation events, so any extra streamed segment (for example a web vital) makes the strict toEqual fail.
Triggered by project rule: PR Review Guidelines for Cursor Bot
Reviewed by Cursor Bugbot for commit cd0da76. Configure here.


What
Ports
react-router-7-lazy-routesto span streaming, the last app in the group.Why
Span streaming is the default now, so the E2E suite has to exercise it. The span-leaking and GQL attribution specs group streamed spans by trace instead of reading a transaction's
spansarray, and they match fetch spans onurl.full, since a streamedhttp.clientspan carries only the domain in its name.Closes: #23798