Skip to content

fix(node-integration-tests): Fix flaky kafkajs test race condition#20189

Merged
Lms24 merged 3 commits intodevelopfrom
copilot/fix-flaky-node-integration-test
Apr 10, 2026
Merged

fix(node-integration-tests): Fix flaky kafkajs test race condition#20189
Lms24 merged 3 commits intodevelopfrom
copilot/fix-flaky-node-integration-test

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 10, 2026

The kafkajs integration test asserted producer and consumer transactions in a fixed order, but they can arrive in either order due to Kafka's async nature.

To fix the flake, we collect both transactions via callbacks, then assert after both have arrived using find() by transaction name instead of relying on arrival order

closes #20121

…tion order independent

The test was flaky because the producer and consumer transactions
could arrive in either order, but the test asserted them in a fixed
sequence. Now both transactions are collected and assertions are
performed after both have been received, regardless of arrival order.

Fixes #20121

Co-Authored-By: Claude <noreply@anthropic.com>

Agent-Logs-Url: https://github.com/getsentry/sentry-javascript/sessions/0bc166af-c93a-42a6-a762-dae244893e2b

Co-authored-by: Lms24 <8420481+Lms24@users.noreply.github.com>
@sdk-maintainer-bot sdk-maintainer-bot bot added missing-issue-reference Used for automated community contribution checks. violating-contribution-guidelines Used for automated community contribution checks. labels Apr 10, 2026
@sdk-maintainer-bot
Copy link
Copy Markdown

This PR has been automatically closed. All non-maintainer contributions must reference an existing GitHub issue.

Next steps:

  1. Find or open an issue describing the problem or feature
  2. Discuss the approach with a maintainer in the issue
  3. Once a maintainer has acknowledged your proposed approach, open a new PR referencing the issue

Please review our contributing guidelines for more details.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 10, 2026

Semver Impact of This PR

🟢 Patch (bug fixes)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

Core

  • Add enableTruncation option to OpenAI integration by andreiborza in #20167
  • Export a reusable function to add tracing headers by JPeer264 in #20076

Deps

  • Bump hono from 4.12.7 to 4.12.12 by dependabot in #20118
  • Bump defu from 6.1.4 to 6.1.6 by dependabot in #20104

Bug Fixes 🐛

  • (deno) Avoid inferring invalid span op from Deno tracer by Lms24 in #20128
  • (e2e) Add op check to waitForTransaction in React Router e2e tests by copilot-swe-agent in #20193
  • (node-integration-tests) Fix flaky kafkajs test race condition by Copilot in #20189

Internal Changes 🔧

  • (bugbot) Add rules to flag test-flake-provoking patterns by Lms24 in #20192
  • (size-limit) Bump failing size limit scenario by Lms24 in #20186

🤖 This preview updates automatically when you update the PR.

@Lms24 Lms24 reopened this Apr 10, 2026
@Lms24 Lms24 self-requested a review April 10, 2026 09:09
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 10, 2026

size-limit report 📦

Path Size % Change Change
@sentry/browser 25.72 kB - -
@sentry/browser - with treeshaking flags 24.21 kB - -
@sentry/browser (incl. Tracing) 42.73 kB - -
@sentry/browser (incl. Tracing, Profiling) 47.35 kB - -
@sentry/browser (incl. Tracing, Replay) 81.54 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 71.11 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 86.25 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 98.45 kB - -
@sentry/browser (incl. Feedback) 42.51 kB - -
@sentry/browser (incl. sendFeedback) 30.39 kB - -
@sentry/browser (incl. FeedbackAsync) 35.38 kB - -
@sentry/browser (incl. Metrics) 27.04 kB - -
@sentry/browser (incl. Logs) 27.18 kB - -
@sentry/browser (incl. Metrics & Logs) 27.86 kB - -
@sentry/react 27.48 kB - -
@sentry/react (incl. Tracing) 45.05 kB - -
@sentry/vue 30.56 kB - -
@sentry/vue (incl. Tracing) 44.59 kB - -
@sentry/svelte 25.74 kB - -
CDN Bundle 28.41 kB - -
CDN Bundle (incl. Tracing) 43.75 kB - -
CDN Bundle (incl. Logs, Metrics) 29.78 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 44.83 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 68.59 kB - -
CDN Bundle (incl. Tracing, Replay) 80.64 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 81.66 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 86.17 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 87.2 kB - -
CDN Bundle - uncompressed 82.99 kB - -
CDN Bundle (incl. Tracing) - uncompressed 129.77 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 87.14 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 133.19 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 210.12 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 246.65 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 250.05 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 259.56 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 262.95 kB - -
@sentry/nextjs (client) 47.47 kB - -
@sentry/sveltekit (client) 43.2 kB - -
@sentry/node-core 57.86 kB +0.02% +7 B 🔺
@sentry/node 174.83 kB +0.01% +10 B 🔺
@sentry/node - without tracing 97.97 kB +0.03% +20 B 🔺
@sentry/aws-serverless 115.22 kB +0.02% +19 B 🔺

View base workflow run

@Lms24 Lms24 removed violating-contribution-guidelines Used for automated community contribution checks. missing-issue-reference Used for automated community contribution checks. labels Apr 10, 2026
@Lms24 Lms24 requested review from a team, logaretm and s1gr1d and removed request for a team April 10, 2026 10:12
@Lms24 Lms24 marked this pull request as ready for review April 10, 2026 10:12
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 282bd66. Configure here.

@Lms24 Lms24 enabled auto-merge (squash) April 10, 2026 11:00
@github-actions
Copy link
Copy Markdown
Contributor

node-overhead report 🧳

Note: This is a synthetic benchmark with a minimal express app and does not necessarily reflect the real-world performance impact in an application.
⚠️ 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.

Scenario Requests/s % of Baseline Prev. Requests/s Change %
GET Baseline 9,073 - 8,908 +2%
GET With Sentry 1,710 19% 1,814 -6%
GET With Sentry (error only) 5,995 66% 6,195 -3%
POST Baseline 1,195 - 1,217 -2%
POST With Sentry 589 49% 615 -4%
POST With Sentry (error only) 1,046 88% 1,061 -1%
MYSQL Baseline 3,167 - 3,228 -2%
MYSQL With Sentry 464 15% 486 -5%
MYSQL With Sentry (error only) 2,595 82% 2,587 +0%

View base workflow run

@Lms24 Lms24 merged commit 05ab207 into develop Apr 10, 2026
472 of 476 checks passed
@Lms24 Lms24 deleted the copilot/fix-flaky-node-integration-test branch April 10, 2026 15:18
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 integration tests - Kafka

3 participants