Skip to content

test(node-core): Fix flaky withMonitor span order assertion#22129

Merged
Lms24 merged 1 commit into
developfrom
fix/flaky-withmonitor-span-order
Jul 9, 2026
Merged

test(node-core): Fix flaky withMonitor span order assertion#22129
Lms24 merged 1 commit into
developfrom
fix/flaky-withmonitor-span-order

Conversation

@Lms24

@Lms24 Lms24 commented Jul 9, 2026

Copy link
Copy Markdown
Member

This PR fixes a flaky withMonitor unit test reported in #22121

The test asserted child span order via toMatchObject, but the span exporter does not guarantee ordering by timestamp. The failure in #22121 showed all three expected spans were present with matching trace IDs but only their order differed.

Replace the order-sensitive assertion with toContainEqual checks, matching the pattern used elsewhere in the same test file.

Fixes #22121

The withMonitor integration test asserted span order via toMatchObject,
but the span exporter does not guarantee child span order. Assert span
presence with toContainEqual instead.

Fixes #22121
Co-Authored-By: Cursor <cursoragent@cursor.com>

Co-authored-by: Cursor <cursoragent@cursor.com>
@Lms24 Lms24 marked this pull request as ready for review July 9, 2026 09:42
@Lms24 Lms24 requested a review from a team as a code owner July 9, 2026 09:42
@Lms24 Lms24 requested review from JPeer264, andreiborza and mydea and removed request for a team July 9, 2026 09:42
@Lms24 Lms24 merged commit 65e1081 into develop Jul 9, 2026
231 checks passed
@Lms24 Lms24 deleted the fix/flaky-withmonitor-span-order branch July 9, 2026 10:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants