Skip to content

[Internal] Tests: Adds timeouts and polling loops for low-impact test reliability#5715

Merged
kirankumarkolli merged 2 commits into
masterfrom
users/nalutripician/test-fix-low-impact-bundle
Mar 20, 2026
Merged

[Internal] Tests: Adds timeouts and polling loops for low-impact test reliability#5715
kirankumarkolli merged 2 commits into
masterfrom
users/nalutripician/test-fix-low-impact-bundle

Conversation

@NaluTripician
Copy link
Copy Markdown
Contributor

Summary

Adds [Timeout] attributes to prevent pipeline budget overruns and replaces fixed Task.Delay waits with bounded polling loops across multiple test files.

Changes

Timeout Attributes

  • ClientTelemetryTests[Timeout(300000)] (5 min) on all 12 test methods. Prevents hanging tests from consuming the entire 60-minute job budget.
  • EndToEndTraceWriterBaselineTests[Timeout(300000)] (5 min) on QueryAsync and TypedPointOperationsAsync.
  • CosmosHttpClientCoreTests[Timeout(120000)] (2 min) on retry tests + increased delay margins past policy thresholds.
  • GlobalEndpointManagerTest[Timeout(30000)] on EndpointFailureMockTest.

Polling Loops (replacing fixed delays)

  • GlobalEndpointManagerTest — Polls for endpoint switch-back instead of fixed 3s sleep.
  • BatchAsyncStreamerTests — Polls for semaphore count instead of fixed 2s sleep.
  • PartitionControllerTests — Polls for lease release via Mock.Verify instead of fixed 100ms sleep.
  • CosmosAuthorizationTests — Bounds the background refresh polling loop with a 20s timeout.

Tests Improved

Test Failures (30 days) Change
PointSuccessOperationsTest 9 Timeout added
EndpointFailureMockTest 2 Polling + Timeout
RetryTransientIssuesTestAsync 1 Timeout + margins
RetryTransientIssuesForQueryPlanTestAsync 1 Timeout + margins
ValidatesCongestionControlAsync 1 Polling loop
Controller_ShouldReleaseLease_IfObserverExits 1 Polling loop
+ 8 more tests preventive Timeout attributes

Impact

… reliability

Adds [Timeout] attributes to prevent pipeline budget overruns and
replaces fixed Task.Delay waits with bounded polling loops across
multiple test files.

Changes:
- ClientTelemetryTests: [Timeout(300000)] on 12 tests
- EndToEndTraceWriterBaselineTests: [Timeout(300000)] on 2 tests
- CosmosHttpClientCoreTests: [Timeout(120000)] + delay margin increases
- GlobalEndpointManagerTest: Polling loop + [Timeout(30000)]
- BatchAsyncStreamerTests: Polling loop for semaphore assertion
- PartitionControllerTests: Polling loop for lease release
- CosmosAuthorizationTests: Bounded polling with 20s timeout

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@kirankumarkolli kirankumarkolli merged commit a1e6af1 into master Mar 20, 2026
32 checks passed
@kirankumarkolli kirankumarkolli deleted the users/nalutripician/test-fix-low-impact-bundle branch March 20, 2026 16:00
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.

2 participants