Repository navigation
fix: measure a mocked timer's due time from when it is started - #1169
Merged
Merged
Conversation
TimerMock read the clock for the first due time on its background thread, after Start() had already returned. When that thread was scheduled late, a clock advance made right after creating or changing the timer was counted before the due time started, so with auto-advance disabled the timer waited for a time that never came. This made TimerMockTests.DisableAutoAdvance_ShouldStartTimerWhenTimeElapsed time out on net48 on Windows CI. The clock is now read on the calling thread, matching the real Timer and PeriodicTimerMock, which measure from construction.
|
|
This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again. |
Test Results 62 files ±0 62 suites ±0 1h 17m 35s ⏱️ + 2m 34s Results for commit b2736e8. ± Comparison against base commit a856b45. This pull request removes 63016 and adds 63016 tests. Note that renamed tests count towards both.This pull request removes 3484 skipped tests and adds 3484 skipped tests. Note that renamed tests count towards both. |
|
This is addressed in release v7.2.0. |
This was referenced Oct 30, 2026
This was referenced Nov 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



TimerMock read the clock for the first due time on its background thread, after Start() had already returned. When that thread was scheduled late, a clock advance made right after creating or changing the timer was counted before the due time started, so with auto-advance disabled the timer waited for a time that never came. This made TimerMockTests.DisableAutoAdvance_ShouldStartTimerWhenTimeElapsed time out on net48 on Windows CI. The clock is now read on the calling thread, matching the real Timer and PeriodicTimerMock, which measure from construction.