Uh oh!
There was an error while loading. Please reload this page.
test(e2e): Port cloudflare-local-workers to span streaming - #23857
Merged
JPeer264 merged 1 commit intoSep 2, 2026
Merged
Conversation
Contributor
size-limit report 📦
|
JPeer264force-pushed
the
jp/e2e-stream-cloudflare-local-workers
branch
from
September 1, 2026 15:21
2d1c8ef to
c90484eCompareJPeer264
marked this pull request as ready for review
September 2, 2026 06:16
JPeer264force-pushed
the
jp/e2e-stream-cloudflare-local-workers
branch
2 times, most recently
from
September 2, 2026 07:46
03f1d82 to
b7f8678Compareandreiborza
approved these changes
Sep 2, 2026
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
JPeer264force-pushed
the
jp/e2e-stream-cloudflare-local-workers
branch
from
September 2, 2026 11:30
b7f8678 to
ccbc395Compare
Comment on lines
+16
to
+22
| const spansPromise = collectStreamedSpans('cloudflare-local-workers', spans => { | ||
| return ( | ||
| spans.some( | ||
| span => | ||
| getSpanOp(span) === 'http.server' && | ||
| span.is_segment && | ||
| span.attributes['url.path']?.value === '/pass-to-object/storage/get', |
Contributor
There was a problem hiding this comment.
Bug: The test now uses collectStreamedSpans and assumes the Worker and Durable Object share a trace_id. If the default traceLifecycle behavior doesn't ensure this, the test will hang.
Severity: MEDIUM
Suggested Fix
Explicitly verify the default traceLifecycle behavior in the Cloudflare SDK ensures trace propagation between Workers and Durable Objects in streaming mode. If the default is not what is expected, explicitly set the traceLifecycle option to enable streaming and ensure trace context is propagated correctly.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location:
dev-packages/e2e-tests/test-applications/cloudflare-local-workers/tests/index.test.ts#L16-L22
Potential issue: The e2e test was migrated to use `collectStreamedSpans`, which groups
spans by `trace_id`. The test's predicate requires a span from the Worker and a span
from the Durable Object to be present in the same group, assuming they share a
`trace_id`. The pull request removes the explicit `traceLifecycle: 'static'`
configuration. If the default behavior in the Cloudflare SDK doesn't enable streaming or
if trace propagation between the Worker and DO is altered by this change, the spans
might get different `trace_id`s. As a result, the test predicate will never be
satisfied, causing the test to hang and eventually time out.
Also affects:
dev-packages/e2e-tests/test-applications/cloudflare-local-workers/src/index.ts:22~27dev-packages/e2e-tests/test-applications/cloudflare-local-workers/src/index.ts:32~37
Did we get this right? 👍 / 👎 to inform future reviews.
Uh oh!
There was an error while loading. Please reload this page.
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 freeto 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.
Ports
cloudflare-local-workersto span streaming.Under streaming a URL-sourced
http.serversegment is named by method only, so the worker segment and the Durable Object segment are both calledGET. The spec tells them apart byurl.pathand keeps asserting that both arrive. Thedbspan check is done viaparent_span_idof the DO segment. Both segments plus the child span are streamed in separate envelopes, so the test usescollectStreamedSpans.