Skip to content

test(node): Fix flaky node cron test#20661

Merged
mydea merged 1 commit intodevelopfrom
fn/fix-cron-flaky
May 5, 2026
Merged

test(node): Fix flaky node cron test#20661
mydea merged 1 commit intodevelopfrom
fn/fix-cron-flaky

Conversation

@mydea
Copy link
Copy Markdown
Member

@mydea mydea commented May 5, 2026

Fixes #20652

cron instrumentation used loggingTransport, which console.logs each envelope as JSON. The scenario also console.logs (You will see this message every second). The runner parses envelopes by splitting child stdout on newlines. Under CI load that mix can produce ordering / buffering issues or fragile parsing compared with sending envelopes over HTTP.

Fix

Align with the pattern used elsewhere (including the ANR fix):

  • scenario.ts — Drop loggingTransport and initialize with dsn: process.env.SENTRY_DSN so the runner-injected URL from the mock ingest server is used.
  • test.ts — Call .withMockSentryServer() so check-ins and the error event are received via the mock HTTP server instead of stdout.

Fixes #20652

cron instrumentation used loggingTransport, which console.logs each envelope as JSON. The scenario also console.logs (You will see this message every second). The runner parses envelopes by splitting child stdout on newlines. Under CI load that mix can produce ordering / buffering issues or fragile parsing compared with sending envelopes over HTTP.

Fix
Align with the pattern used elsewhere (including the ANR fix):

scenario.ts — Drop loggingTransport and initialize with dsn: process.env.SENTRY_DSN so the runner-injected URL from the mock ingest server is used.
test.ts — Call .withMockSentryServer() so check-ins and the error event are received via the mock HTTP server instead of stdout.
@mydea mydea self-assigned this May 5, 2026
@mydea mydea requested a review from a team as a code owner May 5, 2026 07:45
Copy link
Copy Markdown
Member

@JPeer264 JPeer264 left a comment

Choose a reason for hiding this comment

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

Just one question.

Also let's see if the CI goes through

dsn: 'https://public@dsn.ingest.sentry.io/1337',
dsn: process.env.SENTRY_DSN,
release: '1.0',
transport: loggingTransport,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

q: That is removed on purpose?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

yes, this uses a proper mocked sentry server now instead of the logging transport, making sure this cannot interfer with other console logs!

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

size-limit report 📦

⚠️ Warning: Base artifact is not the latest one, because the latest workflow run is not done yet. This may lead to incorrect results. Try to re-run all tests to get up to date results.

Path Size % Change Change
@sentry/browser 26.31 kB - -
@sentry/browser - with treeshaking flags 24.8 kB - -
@sentry/browser (incl. Tracing) 44.2 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 46.42 kB - -
@sentry/browser (incl. Tracing, Profiling) 49.16 kB - -
@sentry/browser (incl. Tracing, Replay) 83.58 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 73.04 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 88.26 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 100.87 kB - -
@sentry/browser (incl. Feedback) 43.47 kB - -
@sentry/browser (incl. sendFeedback) 31.12 kB - -
@sentry/browser (incl. FeedbackAsync) 36.21 kB - -
@sentry/browser (incl. Metrics) 27.62 kB - -
@sentry/browser (incl. Logs) 27.75 kB - -
@sentry/browser (incl. Metrics & Logs) 28.45 kB - -
@sentry/react 28.05 kB - -
@sentry/react (incl. Tracing) 46.42 kB - -
@sentry/vue 31.18 kB - -
@sentry/vue (incl. Tracing) 46.04 kB - -
@sentry/svelte 26.34 kB - -
CDN Bundle 28.91 kB - -
CDN Bundle (incl. Tracing) 46.95 kB - -
CDN Bundle (incl. Logs, Metrics) 30.34 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 48.06 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 69.41 kB - -
CDN Bundle (incl. Tracing, Replay) 84.11 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 85.16 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 89.91 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 91.01 kB - -
CDN Bundle - uncompressed 84.72 kB - -
CDN Bundle (incl. Tracing) - uncompressed 140.31 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 88.92 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 143.77 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 212.86 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 258.11 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 261.56 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 271.81 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 275.25 kB - -
@sentry/nextjs (client) 48.92 kB - -
@sentry/sveltekit (client) 44.67 kB - -
@sentry/node-core 59.13 kB +0.03% +12 B 🔺
@sentry/node 170.63 kB +0.01% +10 B 🔺
@sentry/node - without tracing 97.17 kB +0.01% +7 B 🔺
@sentry/aws-serverless 113.99 kB +0.03% +31 B 🔺
@sentry/cloudflare (withSentry) - minified 165.2 kB - -
@sentry/cloudflare (withSentry) 417.71 kB - -

View base workflow run

@mydea mydea merged commit 410600e into develop May 5, 2026
48 checks passed
@mydea mydea deleted the fn/fix-cron-flaky branch May 5, 2026 08:25
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.

[Flaky CI]: Node (20) Integration Tests - suites/cron/cron/test.ts > cron instrumentation

2 participants