Repository navigation
Make exposure shutdown flush test deterministic - #9401
Conversation
Co-authored-by: btthomas <9452950+btthomas@users.noreply.github.com>
|
Bits Code status: ✅ Done Comment @DataDog to request changes |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
More details
The send gates now control disposal completion without a shutdown-deadline race, and the completed static reviewer found no actionable regression in the assertions or cleanup. Full test execution remains unverified because the required .NET SDK is unavailable.
🤖 Bits Code Review · Commit 35d158f
bouwkast
left a comment
There was a problem hiding this comment.
Could you link me the job where this failed with the one minute timer?
From what I can see in the logs the root cause appears to be threadpool starvation caused by ConcurrentSettingsUpdateAndLeaseAcquisition_ThreadSafe and the logs I've found so far are from the prior 5s timeout.
bouwkast
left a comment
There was a problem hiding this comment.
ConcurrentSettingsUpdateAndLeaseAcquisition_ThreadSafe likely needs to be moved to a non-parallel collection and can be done in a different PR (I think it is the cause of this test failing before)
Execution-Time Benchmarks Report ⏱️Execution-time results for samples comparing This PR (9401) and master.
|
|||||||||||||||
| Metric | Master (Mean ± 95% CI) | Current (Mean ± 95% CI) | Change | Status |
|---|---|---|---|---|
| .NET Framework 4.8 - Bailout | ||||
| duration | 76.33 ± (76.21 - 76.58) ms | 83.14 ± (82.71 - 83.26) ms | +8.9% | ❌⬆️ |
BenchmarksBenchmark execution time: 2026-10-13 14:41:48 Comparing candidate commit 35d158f in PR branch Found 0 performance improvements and 11 performance regressions! Performance is the same for 61 metrics, 0 unstable metrics, 74 known flaky benchmarks, 52 flaky benchmarks without significant changes.
|
Summary of changes
Reason for change
DisposeFlushesEventsQueuedWhileAnEarlierBatchIsSending assumes Dispose remains blocked until the test releases the final request. However, the test configured a finite shutdown timeout. Dispose intentionally stops waiting when that deadline expires, even if a request remains blocked. If thread-pool scheduling delays the test's continuation, its assertion observes a completed Dispose task after the deadline and incorrectly reports a flush failure. The approximately five-second failed runs match the original five-second shutdown allowance.
Current master already contains #9396, which raised that allowance to one minute. That reduces the chance of failure but retains the same race. The send loop already awaits the final flush, and Dispose waits for that loop until the configured deadline; the separate bounded-shutdown test explicitly requires timeout expiry to release shutdown. This is a test synchronization issue.
Implementation details
Test coverage
Other details
PR by Bits - View session in Datadog
Comment @DataDog to request changes