Skip to content

test(e2e): Port cloudflare-local-workers to span streaming - #23857

Merged
JPeer264 merged 1 commit into
jp/e2e-stream-cloudflare-workersentrypointfrom
jp/e2e-stream-cloudflare-local-workers
Sep 2, 2026
Merged

JPeer264 merged 1 commit into
jp/e2e-stream-cloudflare-workersentrypointfrom
jp/e2e-stream-cloudflare-local-workers

Conversation

@JPeer264

@JPeer264 JPeer264 commented Sep 1, 2026

Copy link
Copy Markdown
Member

Ports cloudflare-local-workers to span streaming.

Under streaming a URL-sourced http.server segment is named by method only, so the worker segment and the Durable Object segment are both called GET. The spec tells them apart by url.path and keeps asserting that both arrive. The db span check is done via parent_span_id of the DO segment. Both segments plus the child span are streamed in separate envelopes, so the test uses collectStreamedSpans.

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 28.57 kB - -
@sentry/browser - with treeshaking flags 26.94 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 26.83 kB - -
@sentry/browser (incl. Tracing) 48.87 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 48.88 kB - -
@sentry/browser (incl. Tracing, Profiling) 51.8 kB - -
@sentry/browser (incl. Tracing, Replay) 88.36 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 77.76 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 93.05 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 106.02 kB - -
@sentry/browser (incl. Feedback) 46.06 kB - -
@sentry/browser (incl. sendFeedback) 33.64 kB - -
@sentry/browser (incl. FeedbackAsync) 38.74 kB - -
@sentry/browser (incl. Metrics) 29.52 kB - -
@sentry/browser (incl. Logs) 29.81 kB - -
@sentry/browser (incl. Metrics & Logs) 30.45 kB - -
@sentry/react 30.32 kB - -
@sentry/react (incl. Tracing) 51.08 kB - -
@sentry/vue 35.74 kB - -
@sentry/vue (incl. Tracing) 51.14 kB - -
@sentry/svelte 28.6 kB - -
CDN Bundle 30.36 kB - -
CDN Bundle (incl. Tracing) 49.52 kB - -
CDN Bundle (incl. Logs, Metrics) 32.59 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 51.43 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 73.19 kB - -
CDN Bundle (incl. Tracing, Replay) 87 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 88.88 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 92.93 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 94.83 kB - -
CDN Bundle - uncompressed 89.97 kB - -
CDN Bundle (incl. Tracing) - uncompressed 147.57 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 96.27 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 153.26 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 225.43 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 267.07 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 272.74 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 280.77 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 286.43 kB - -
@sentry/nextjs (client) 53.7 kB - -
@sentry/sveltekit (client) 49.3 kB - -
@sentry/core/server 40.74 kB - -
@sentry/core/browser 13.42 kB - -
@sentry/node 124.12 kB +0.02% +21 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 81.51 kB - -
@sentry/node - without tracing 88.3 kB +0.03% +22 B 🔺
@sentry/node - without channel injection 103.42 kB +0.02% +20 B 🔺
@sentry/aws-serverless 96.66 kB +0.03% +25 B 🔺
@sentry/cloudflare (withSentry) - minified 200.81 kB - -
@sentry/cloudflare (withSentry) 499.76 kB - -

View base workflow run

@JPeer264
JPeer264 force-pushed the jp/e2e-stream-cloudflare-local-workers branch from 2d1c8ef to c90484e Compare September 1, 2026 15:21
@JPeer264
JPeer264 marked this pull request as ready for review September 2, 2026 06:16
@JPeer264
JPeer264 force-pushed the jp/e2e-stream-cloudflare-local-workers branch 2 times, most recently from 03f1d82 to b7f8678 Compare September 2, 2026 07:46
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@JPeer264
JPeer264 force-pushed the jp/e2e-stream-cloudflare-local-workers branch from b7f8678 to ccbc395 Compare September 2, 2026 11:30
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',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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~27
  • dev-packages/e2e-tests/test-applications/cloudflare-local-workers/src/index.ts:32~37

Did we get this right? 👍 / 👎 to inform future reviews.

@JPeer264
JPeer264 merged commit 7b6adc1 into develop Sep 2, 2026
46 checks passed
@JPeer264
JPeer264 deleted the jp/e2e-stream-cloudflare-local-workers branch September 2, 2026 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants