Repository navigation
Conversation
…ntation API e2e test Streamed spans flush after errors, so the segment span listener could pick up a late span from an earlier test that hit the same route, making the trace id assertion flaky (mostly in dev mode). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
size-limit report 📦Compared: c31a5d1 (PR test merge using develop at a6c28d0) Against: a6c28d0 (develop) · base run #63870 ✅ Baseline matches: this diff contains only this PR's changes.
|
s1gr1d
left a comment
There was a problem hiding this comment.
While this would fix the flake, we could still solve this at the "root" by just not hitting the same endpoint in every test. Maybe we can add a parametrized route (e.g. /error-loader/:test-id) or something.
yeah this is a good point, maybe worth it to rewrite this 👍 |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 4ecb93d. Configure here.
| function isErrorLoaderSegment(span: SerializedStreamedSpan, id: string): boolean { | ||
| const url = span.attributes['url.full']?.value; | ||
| return span.is_segment && typeof url === 'string' && url.endsWith(`/performance/error-loader/${id}`); | ||
| } |
There was a problem hiding this comment.
Span matcher collides with client pageload
Medium Severity
isErrorLoaderSegment accepts any segment whose url.full ends with the test path. A client pageload segment for that same URL also matches, and streamed server spans flush later, so waitForStreamedSpan can resolve the client span. The mechanism test then fails its http.server / GET ... checks. This is flagged because the testing conventions require wait predicates to be unique when telemetry can arrive in any order.
Additional Locations (2)
Triggered by project rule: PR Review Guidelines for Cursor Bot
Reviewed by Cursor Bugbot for commit 4ecb93d. Configure here.


error and segment span should share the same traceis flaky in the dev-mode run ofreact-router-7-framework-instrumentation. On recent develop runs it fails on the first attempt and passes on retry, and on #25602 it failed every retry.Root cause: errors are sent right away but streamed spans are buffered and flushed later. The three tests before this one all hit
/performance/error-loader, so the segment span listener picks up a late span from an earlier request. In every failed attempt, the error's trace id matches the span the next attempt receives.Rather than working around this in the assertion, the route is now
/performance/error-loader/:idand each loader test requests its own id. The loader puts the id into the error message, and tests match the segment span byurl.full, so a late error or span from another test can no longer match.🤖 Generated with Claude Code