Skip to content

test(e2e): Resend requests until the deployed Cloudflare Worker answers - #24560

Open
JPeer264 wants to merge 4 commits into
developfrom
test/cloudflare-send-to-sentry-flaky-unhandled
Open

JPeer264 wants to merge 4 commits into
developfrom
test/cloudflare-send-to-sentry-flaky-unhandled

Conversation

@JPeer264

Copy link
Copy Markdown
Member

The unhandled exception test of cloudflare-workers-send-to-sentry lost its event in about 3 of 67 runs. In those runs Cloudflare answered the request with a 500 while Workers Logs had no invocation for it, so the Worker never ran and nothing was sent. Both inspected cases were the first deployment of a Worker name. The test only checked the status, so it polled Sentry for three minutes for an event that did not exist.

All three tests now send their request through fetchFromWorker, which resends until the Worker itself answers. A Worker that threw answers with status 500 and the body "error code: 1101", which sets it apart from a 500 that did not come from the Worker. Other answers are logged with status, cf-ray and body.

deployed-worker, global-setup and global-teardown are now TypeScript modules, and the typecheck covers them and the tests, so the tests no longer import deployed-worker as any.

@JPeer264
JPeer264 requested a review from a team September 21, 2026 13:12
@JPeer264 JPeer264 self-assigned this Sep 21, 2026
@JPeer264
JPeer264 requested review from isaacs and mydea and removed request for a team September 21, 2026 13:12
@github-actions

github-actions Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 29.16 kB - -
@sentry/browser - with treeshaking flags 27.42 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 27.33 kB - -
@sentry/browser (incl. Tracing) 50.62 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 50.64 kB - -
@sentry/browser (incl. Tracing, Profiling) 53.62 kB - -
@sentry/browser (incl. Tracing, Replay) 90.21 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 79.31 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 94.9 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 107.85 kB - -
@sentry/browser (incl. Feedback) 46.69 kB - -
@sentry/browser (incl. sendFeedback) 34.22 kB - -
@sentry/browser (incl. FeedbackAsync) 39.32 kB - -
@sentry/browser (incl. Metrics) 30.18 kB - -
@sentry/browser (incl. Logs) 30.43 kB - -
@sentry/browser (incl. Metrics & Logs) 31.09 kB - -
@sentry/react 30.91 kB - -
@sentry/react (incl. Tracing) 52.91 kB - -
@sentry/vue 36.41 kB - -
@sentry/vue (incl. Tracing) 52.9 kB - -
@sentry/svelte 29.18 kB - -
CDN Bundle 30.86 kB - -
CDN Bundle (incl. Tracing) 51.12 kB - -
CDN Bundle (incl. Logs, Metrics) 33.12 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 53.09 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 73.84 kB - -
CDN Bundle (incl. Tracing, Replay) 88.7 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 90.63 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 94.76 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 96.75 kB - -
CDN Bundle - uncompressed 91.25 kB - -
CDN Bundle (incl. Tracing) - uncompressed 152.53 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 97.82 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 158.48 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 227.39 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 272.26 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 278.2 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 285.96 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 291.89 kB - -
@sentry/nextjs (client) 55.24 kB - -
@sentry/sveltekit (client) 51.04 kB - -
@sentry/core/server 39.93 kB - -
@sentry/core/browser 13.63 kB - -
@sentry/node 133.38 kB +0.02% +19 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 82.15 kB - -
@sentry/node - without tracing 89.93 kB +0.03% +23 B 🔺
@sentry/node - without channel injection 112.17 kB +0.03% +25 B 🔺
@sentry/aws-serverless 98.2 kB +0.02% +18 B 🔺
@sentry/cloudflare (withSentry) - minified 205.06 kB - -
@sentry/cloudflare (withSentry) 510.44 kB - -

View base workflow run

JPeer264 and others added 4 commits September 22, 2026 11:33
The unhandled exception test of cloudflare-workers-send-to-sentry lost its
event in about 3 of 67 runs. In those runs Cloudflare answered the request
with a 500 while Workers Logs had no invocation for it, so the Worker never
ran and nothing was sent. Both inspected cases were the first deployment of
a Worker name. The test only checked the status, so it polled Sentry for
three minutes for an event that did not exist.

All three tests now send their request through fetchFromWorker, which
resends until the Worker itself answers. A Worker that threw answers with
status 500 and the body "error code: 1101", which sets it apart from a 500
that did not come from the Worker. Other answers are logged with status,
cf-ray and body.

deployed-worker, global-setup and global-teardown are now TypeScript
modules, and the typecheck covers them and the tests, so the tests no
longer import deployed-worker as `any`.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…r answers

The Worker code is checked with @cloudflare/workers-types, whose globals
replace the Node types of Buffer and URL, so the Node side of the test app
failed to typecheck in the same project. Check it in tsconfig.node.json with
Node types only.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…r answers

Cloudflare sends its 1101 error page as HTML to Node's fetch and only sends
the plain text `error code: 1101` to some other clients, so the strict body
comparison never matched in the test. Read the error code from either format.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…r answers

Cloudflare ends the plain text error body with a newline, and `$` without
the `m` flag only matches at the very end of the string, so a plain text
1101 answer never matched.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@JPeer264
JPeer264 force-pushed the test/cloudflare-send-to-sentry-flaky-unhandled branch from ad7867e to 6ea1f58 Compare September 22, 2026 09:43

This branch has not been deployed

No deployments
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.

1 participant