Repository navigation
fix: record the cancellation time before the wait continues - #1034
Merged
Merged
Conversation
`WhenCancelledDuringTheWaitThatConsumesTheTimeout_ShouldBeInconclusive` still failed on the Windows agent after the cancellation was timed in a registration callback, because `Task.Delay(wait, cancellationToken)` registers a callback on the same token. Cancellation callbacks run in reverse registration order, so the delay is released first and its continuation can read `cancelledAt` before the callback that records it has run. It then falls back to the time the cancellation was observed, which is exactly the value that made a cancelled expectation look like an expired one. The wait no longer takes the token. It completes either by its own timer or by a task that the recording callback itself completes, so the recorded time is always visible to the attempt that continues.
|
Contributor
Test Results 23 files - 27 23 suites - 27 9m 19s ⏱️ +28s Results for commit e4477a8. ± Comparison against base commit affdbc3. This pull request removes 3230 and adds 3192 tests. Note that renamed tests count towards both. |
Contributor
🚀 Benchmark ResultsDetails
|
Contributor
👽 Mutation ResultsaweXpectDetails
The final mutation score is NaN%Coverage Thresholds: high:80 low:60 break:0aweXpect.CoreDetails
The final mutation score is 72.06%Coverage Thresholds: high:80 low:60 break:0 |
github-actions Bot
added a commit
that referenced
this pull request
Sep 6, 2026
…e the wait continues (#1034) by Valentin Breuß
github-actions Bot
added a commit
that referenced
this pull request
Sep 6, 2026
…e the wait continues (#1034) by Valentin Breuß
vbreuss
added a commit
that referenced
this pull request
Sep 6, 2026
`DefaultCheckInterval_ShouldDetermineTheNumberOfEvaluations` asserted at least two evaluations, which a build agent cannot guarantee: when the first evaluation alone uses up the one second retry budget - a cold and busy agent JITs the whole expectation pipeline on the way - the subject is evaluated once and the assertion fails. The upper bound is what the test is about: a 200ms check interval within a one second budget allows at most six evaluations, while an ignored interval would evaluate the subject far more often. How many of the six a machine reaches is a property of that machine, not of the check interval. `WhenCancelledDuringTheWaitThatConsumesTheTimeout_ShouldBeInconclusive` was skipped while the cancellation of a wait could be observed after the retry budget had expired. That race is fixed (#1034), so it runs again.
vbreuss
added a commit
that referenced
this pull request
Sep 6, 2026
`DefaultCheckInterval_ShouldDetermineTheNumberOfEvaluations` asserted at least two evaluations, which a build agent cannot guarantee: when the first evaluation alone uses up the one second retry budget - a cold and busy agent JITs the whole expectation pipeline on the way - the subject is evaluated once and the assertion fails. The upper bound is what the test is about: a 200ms check interval within a one second budget allows at most six evaluations, while an ignored interval would evaluate the subject far more often. How many of the six a machine reaches is a property of that machine, not of the check interval. `WhenCancelledDuringTheWaitThatConsumesTheTimeout_ShouldBeInconclusive` was skipped while the cancellation of a wait could be observed after the retry budget had expired. That race is fixed (#1034), so it runs again.
Contributor
|
This is addressed in release v2.38.0. |
This was referenced Sep 14, 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.



WhenCancelledDuringTheWaitThatConsumesTheTimeout_ShouldBeInconclusivestill failed on the Windows agent after the cancellation was timed in a registration callback, becauseTask.Delay(wait, cancellationToken)registers a callback on the same token. Cancellation callbacks run in reverse registration order, so the delay is released first and its continuation can readcancelledAtbefore the callback that records it has run. It then falls back to the time the cancellation was observed, which is exactly the value that made a cancelled expectation look like an expired one.The wait no longer takes the token. It completes either by its own timer or by a task that the recording callback itself completes, so the recorded time is always visible to the attempt that continues.