Skip to content

test(node): Make mongodb tests less flaky#20598

Closed
mydea wants to merge 1 commit intodevelopfrom
fn/mongodb-flaky-test
Closed

test(node): Make mongodb tests less flaky#20598
mydea wants to merge 1 commit intodevelopfrom
fn/mongodb-flaky-test

Conversation

@mydea
Copy link
Copy Markdown
Member

@mydea mydea commented Apr 29, 2026

Closes #20424

@mydea mydea self-assigned this Apr 29, 2026
@mydea mydea requested a review from a team as a code owner April 29, 2026 11:51
@github-actions
Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 26.16 kB - -
@sentry/browser - with treeshaking flags 24.63 kB - -
@sentry/browser (incl. Tracing) 44.11 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 46.16 kB - -
@sentry/browser (incl. Tracing, Profiling) 49.06 kB - -
@sentry/browser (incl. Tracing, Replay) 83.46 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 72.94 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 88.14 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 100.79 kB - -
@sentry/browser (incl. Feedback) 43.4 kB - -
@sentry/browser (incl. sendFeedback) 30.96 kB - -
@sentry/browser (incl. FeedbackAsync) 36.14 kB - -
@sentry/browser (incl. Metrics) 27.44 kB - -
@sentry/browser (incl. Logs) 27.59 kB - -
@sentry/browser (incl. Metrics & Logs) 28.28 kB - -
@sentry/react 27.9 kB - -
@sentry/react (incl. Tracing) 46.35 kB - -
@sentry/vue 31.03 kB - -
@sentry/vue (incl. Tracing) 45.95 kB - -
@sentry/svelte 26.18 kB - -
CDN Bundle 28.84 kB - -
CDN Bundle (incl. Tracing) 46.71 kB - -
CDN Bundle (incl. Logs, Metrics) 30.25 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 47.8 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 69.34 kB - -
CDN Bundle (incl. Tracing, Replay) 83.88 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 84.94 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 89.69 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 90.78 kB - -
CDN Bundle - uncompressed 84.55 kB - -
CDN Bundle (incl. Tracing) - uncompressed 139.68 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 88.75 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 143.14 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 212.71 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 257.49 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 260.93 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 271.18 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 274.62 kB - -
@sentry/nextjs (client) 48.84 kB - -
@sentry/sveltekit (client) 44.56 kB - -
@sentry/node-core 58.96 kB +0.02% +9 B 🔺
@sentry/node 170.25 kB +0.01% +11 B 🔺
@sentry/node - without tracing 96.82 kB +0.01% +8 B 🔺
@sentry/aws-serverless 113.69 kB +0.03% +33 B 🔺
@sentry/cloudflare (withSentry) - minified 164.13 kB - -
@sentry/cloudflare (withSentry) 415.2 kB - -

View base workflow run

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.

Tbh I don't feel quite comfy to approve this. We get rid of a lot of assertions. And the flaked test actually has one extra trace with the "status": "internal_error",

So not sure if it is our goal to make it less flaky by just making it more loose. What would happen if we accidentally add another span (e.g. double instrumentation), this would get lost with it, as we would never know

Copy link
Copy Markdown
Member

@chargome chargome left a comment

Choose a reason for hiding this comment

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

LGTM, but we recently talked about being more conservative with arrayContaining and objectContaining and instead just assert more specifically

@mydea
Copy link
Copy Markdown
Member Author

mydea commented Apr 29, 2026

Hmm I am not 100% sure. IMHO the stuff I dropped in this PR are not really important - it's just what otel emits today, but if we were to re-implement this we likely would not care about these. So not sure if it makes sense to assert that they are all there if we don't really care about them 🤔 If we care about those, then yes we should assert that they are in there (but still do so in a way that does not assert on the array order).

If we do not omit these, then we need to somehow rewrite this test to figure out when it is adding these spans and when not (as it is apparently not that deterministic as of now as they are usually not there but apparently sometimes there).

Not sure I agree with the sentiment that we should check for exact array matches, as this kind of ends up testing things that we do not actually care to test. e.g. what if some other thing emits a span into this, or the order of spans changes, these are all things that do not relate to this test at all so we should not assert on it specifically IMHO.

I also do not actually want to spend too many cycles on this though, so I'll just close this for now and we can always revisit it :)

@mydea mydea closed this Apr 29, 2026
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 (18) Integration Tests - suites/tracing/mongodb/test.ts > MongoDB experimental Test > CJS - should auto-instrument mongodb package.

3 participants