Repository navigation
test: make three timing-dependent tests deterministic - #982
Conversation
…a scoped meter factory
There was a problem hiding this comment.
🤖 NCode Review at e92fd15: 4 new findings on the changed lines.
|
Superseded by the review at cfdd354. |
…ectoryMetricsTests
…feed and replica-health tests
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #982 +/- ##
===========================================
- Coverage 96.20% 65.60% -30.61%
===========================================
Files 2437 1529 -908
Lines 114032 57989 -56043
Branches 196 1753 +1557
===========================================
- Hits 109709 38044 -71665
- Misses 4323 19945 +15622
Flags with carried forward coverage won't be shown. Click here to find out more. 📢 Thoughts on this report? Let us know! 🚀 New features to boost your workflow:
|
|
/review |
There was a problem hiding this comment.
Approved at cfdd354: no blocker or should-fix finding remains.
🤖 Review completeVerdict: ✅ Approve — Re-review of what changed since the last review at e92fd15: 23 hunks in 6 files and changes taken back in 5 files, by correctness only. Earlier findings: F1 fixed, F2 fixed, F3 fixed, F4 fixed. No further findings above nits. Approval: Approved — no blocker or should-fix finding remains. 1 reviewer run — 0 findings (run details)
Trial: findings are posted as review threads and in the check run. $0.08 on Amazon Bedrock, 12s, at cfdd354. (how to interact) 📋 OutcomesMerged at cfdd354: 4 fixed, 0 dismissed, 0 acknowledged, 0 ignored.
|
|
Autopilot: this pull request is ready to merge as far as this run can tell.
After it merges, run |
Makes three timing-dependent tests deterministic, and applies the same fixes to their sibling tests:
DefaultOpenIdTeamCacheTests: every team that an eviction or expiry releases for the last time has itsDisposeAsyncCoreset up and awaited. The creators release their own references first, so the cache's background eviction always ends the last one. Each wait uses oneDisposalTimeout.TeamSettingsReconciliationServiceTests: the retry-at-deadline test starts itsFakeTimeProviderat a fixed instant. The clock moves from inside the reconciler call on the service's own loop, never from the test thread, so the service never arms a timer from a stale clock read.DirectoryOutboxPublisherTests,DirectoryChangeFeedServiceTests,DirectoryReplicaHealthTests: everyDirectoryMetricscomes from theIMeterFactoryof the test's ownAddMetrics()provider. The published-counter test collects with aMetricCollectorscoped to that factory, never with a process-wideMeterListener.DirectoryMetricsTestspins the directory metrics' meter, instrument and attribute names and their units as literals.csharp-testing.instructions.mdrecords the three lessons.Each changed suite passed five runs in a row.
Protected paths changed:
.github/instructions/csharp-testing.instructions.md
Closes #981