test(e2e): Migrate nitro-3 to span streaming - #23946
Merged
Merged
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
size-limit report 📦
|
s1gr1d
marked this pull request as ready for review
September 2, 2026 14:28
Storage span names are `cache.{operation}` under span streaming since #23830.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
s1gr1d
marked this pull request as draft
September 2, 2026 14:48
s1gr1d
marked this pull request as ready for review
September 8, 2026 08:43
Contributor
|
👋 @logaretm, @andreiborza — Please review this PR when you get a chance! |
andreiborza
approved these changes
Sep 8, 2026
Comment on lines
+11
to
+18
| const spans = await collectStreamedSpans('nitro-3', spans => | ||
| spans.some(span => span.is_segment && span.attributes['url.path']?.value === '/api/test-cache'), | ||
| ); | ||
| const segmentSpan = spans.find(span => span.is_segment && span.attributes['url.path']?.value === '/api/test-cache'); | ||
|
|
||
| return spans.filter( | ||
| span => span.trace_id === segmentSpan?.trace_id && span.attributes['sentry.origin']?.value === 'auto.cache.nitro', | ||
| ); |
Member
There was a problem hiding this comment.
l: You can use this helper instead:
const spans = await collectStreamedSpansUntilSegment(
'nitro-3',
span => span.attributes['url.path']?.value === '/api/test-cache',
);
return spans.filter(span => span.attributes['sentry.origin']?.value === 'auto.cache.nitro');
Member
Author
There was a problem hiding this comment.
ah thanks! that did not exists at the time of the PR :D
Comment on lines
+7
to
+11
| const spans = await collectStreamedSpans('nitro-3', spans => | ||
| spans.some(span => span.is_segment && span.name === 'GET /api/test-nesting'), | ||
| ); | ||
| const segmentSpan = spans.find(span => span.is_segment && span.name === 'GET /api/test-nesting'); | ||
| return spans.filter(span => span.trace_id === segmentSpan?.trace_id); |
Comment on lines
+7
to
+14
| const spans = await collectStreamedSpans('nitro-3', spans => | ||
| spans.some(span => span.is_segment && span.attributes['url.path']?.value === route), | ||
| ); | ||
| const segmentSpan = spans.find(span => span.is_segment && span.attributes['url.path']?.value === route); | ||
|
|
||
| return spans.filter( | ||
| span => span.trace_id === segmentSpan?.trace_id && span.attributes['sentry.origin']?.value === 'auto.cache.nitro', | ||
| ); |
Comment on lines
+7
to
+13
| const spans = await collectStreamedSpans('nitro-3', spans => | ||
| spans.some(span => span.is_segment && span.attributes['url.path']?.value === route), | ||
| ); | ||
| const segmentSpan = spans.find(span => span.is_segment && span.attributes['url.path']?.value === route); | ||
|
|
||
| return spans.filter( | ||
| span => span.trace_id === segmentSpan?.trace_id && span.attributes['sentry.origin']?.value === 'auto.cache.nitro', |
logaretm
approved these changes
Sep 8, 2026
Replace the hand-rolled accumulate-until-segment logic with the shared test-utils helper, as suggested in review. The helper already scopes the result to the matched trace, so the per-trace filtering falls away. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reference #23804
Two things had to change beyond the mechanical port. The tests assumed the srvx request span is the segment (root) span of a request. At runtime the segment comes from the node
http_serverintegration, and the srvx span nests below it — so the origin and parent assertions now reflect that. The isolation test also read scope tags off the transaction event; streamed spans do not carry scope tags, so request isolation is now asserted via the error event's tags only.