Skip to content

test(sampler-aws-xray): stabilize flaky setTimeout intervals under CI load#3439

Open
Sigmabrogz wants to merge 1 commit intoopen-telemetry:mainfrom
Sigmabrogz:fix/flaky-aws-xray-sampler-tests-v2
Open

test(sampler-aws-xray): stabilize flaky setTimeout intervals under CI load#3439
Sigmabrogz wants to merge 1 commit intoopen-telemetry:mainfrom
Sigmabrogz:fix/flaky-aws-xray-sampler-tests-v2

Conversation

@Sigmabrogz
Copy link

Fixes #3394

Problem

In recent days, there has been an uptick in flaky tests in @opentelemetry/sampler-aws-xray. Specifically, the tests in remote-sampler.test.ts depend on setTimeout arrays to wait for internal network mocks (nock) to resolve and for sinon fake timer clocks to cycle. Under heavy CI load, the default 500ms bounds are too tight, causing the setTimeout assertion checks to fire before the internal simulated state has fully updated, leading to random test failures.

Fix

  • Increased the terminal setTimeout bounds from 500ms to 1000ms within remote-sampler.test.ts.
  • This gives the internal fetchSamplingRules callback queue sufficient padding to drain across the event loop without artificially slowing down the fast-path passes, effectively stabilizing the test under noisy neighbor CI environments.

I ran the test suite locally multiple times and the sampler suite passes cleanly now.


This PR was created with AI assistance.

Made with Cursor

… load

Fixes open-telemetry#3394

Increased the terminal setTimeout bounds from 500ms to 1000ms within
remote-sampler.test.ts. This gives the internal fetchSamplingRules
callback queue sufficient padding to drain across the event loop
without artificially slowing down the fast-path passes, effectively
stabilizing the test under noisy neighbor CI environments.

Made-with: Cursor
@Sigmabrogz Sigmabrogz requested a review from a team as a code owner March 14, 2026 05:53
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Mar 14, 2026

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: Sigmabrogz / name: Sigmabro (1b9c2db)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[sampler-aws-xray] flaky tests

3 participants