Skip to content

fix: only count the time a timer callback is blocked towards the limit that moves the clock on - #1192

Merged
vbreuss merged 2 commits into
mainfrom
fix/hold-the-clock-while-a-callback-runs
Nov 4, 2026
Merged

vbreuss merged 2 commits into
mainfrom
fix/hold-the-clock-while-a-callback-runs

Conversation

@vbreuss

@vbreuss vbreuss commented Nov 4, 2026

Copy link
Copy Markdown
Member

The thread that fires a timer waits for its callback for at most one second of real time, so that a callback which blocks on the code that moves the clock cannot deadlock it. On a loaded machine, a callback that still runs but whose thread does not get scheduled for a second hit the same limit, so the clock passed the next timer before the callback completed. This let a delay run to its end although an earlier timeout canceled it, which made NestedWait_WhenTheTimeoutIsShorter_ShouldFailWithTheTimeoutOnTheTimeProviderOfTheEvaluation in aweXpect flaky on CI.

The limit now only counts the time in which the thread of the callback is blocked in a wait. A callback that keeps running, e.g. one that spins until the clock moves, still releases the clock after 30 seconds.

…t that moves the clock on

The thread that fires a timer waits for its callback for at most one second of real time, so that a callback which blocks on the code that moves the clock cannot deadlock it. On a loaded machine, a callback that still runs but whose thread does not get scheduled for a second hit the same limit, so the clock passed the next timer before the callback completed. This let a delay run to its end although an earlier timeout canceled it, which made `NestedWait_WhenTheTimeoutIsShorter_ShouldFailWithTheTimeoutOnTheTimeProviderOfTheEvaluation` in aweXpect flaky on CI.

The limit now only counts the time in which the thread of the callback is blocked in a wait. A callback that keeps running, e.g. one that spins until the clock moves, still releases the clock after 30 seconds.
@vbreuss vbreuss self-assigned this Nov 4, 2026
@mergify

mergify Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

This pull request is merged.

@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Test Results

     80 files  ± 0       80 suites  ±0   1h 41m 19s ⏱️ +26s
 87 916 tests  -  7   83 226 ✅  -  7   4 690 💤 ±0  0 ❌ ±0 
203 640 runs  +13  183 918 ✅ +13  19 722 💤 ±0  0 ❌ ±0 

Results for commit 677c61a. ± Comparison against base commit 0b00896.

This pull request removes 84599 and adds 84591 tests. Note that renamed tests count towards both.
  )
)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(00d4f0c6-432b-4efd-aec3-909736520b9a)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(0a8cbfb4-4a54-459c-90ec-d18c0b7e7077)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(1a162c30-e93b-4c94-9540-18888d8acb05)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(21b8d23d-a33e-431a-b08a-b2ef4a9efc9d)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(31acba64-0048-4a73-bea6-fc930cc4999a)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(66081b3b-71b4-490a-8786-1d98794923e7)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(6aaf1ea3-0558-406f-8cf0-7286831f73e1)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(7568bea3-6c50-4daf-8c77-2b31f99e4ab8)
…
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(18ef65f7-aa96-4d50-9f84-2f1dfd09d004)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(26e997d0-89af-4bb1-b212-246212d53ae6)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(32fc2a71-b538-4ee7-9c19-4579a316cb39)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(3e294e1e-04d4-455d-9e07-1fd4f61a0b35)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(3fe9372c-4654-465b-8b14-8a4fa3e8fb72)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(4372b0e3-8379-4f53-93b1-1dd56df91736)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(45b55480-7f00-4e33-902e-ae0912365428)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(47bf896d-b4db-4df2-b147-6124dc558711)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(5119440a-efac-43e8-8276-fa30e2a8b794)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(52d10ced-876c-4237-8798-10672629ff2e)
…
This pull request removes 4662 skipped tests and adds 4662 skipped tests. Note that renamed tests count towards both.
Testably.Abstractions.Testing.Tests.FileSystem.FileMockTests ‑ GetUnixFileMode_SafeFileHandle_ShouldThrowPlatformNotSupportedExceptionOnWindows(0e9e459a-4c6f-4403-b710-a7981ac2398c)
Testably.Abstractions.Testing.Tests.FileSystem.FileMockTests ‑ GetUnixFileMode_SafeFileHandle_ShouldThrowPlatformNotSupportedExceptionOnWindows(13da0848-b7ea-4c32-b1c9-29b95307ba56)
Testably.Abstractions.Testing.Tests.FileSystem.FileMockTests ‑ GetUnixFileMode_SafeFileHandle_ShouldThrowPlatformNotSupportedExceptionOnWindows(3b4093b1-c1b2-4e81-ac2b-75b52800efb0)
Testably.Abstractions.Testing.Tests.FileSystem.FileMockTests ‑ GetUnixFileMode_SafeFileHandle_ShouldThrowPlatformNotSupportedExceptionOnWindows(3f87c793-3351-4878-bf48-b47b34b54a09)
Testably.Abstractions.Testing.Tests.FileSystem.FileMockTests ‑ GetUnixFileMode_SafeFileHandle_ShouldThrowPlatformNotSupportedExceptionOnWindows(446e4824-fe3f-4122-808f-fcb905d6f9d6)
Testably.Abstractions.Testing.Tests.FileSystem.FileMockTests ‑ GetUnixFileMode_SafeFileHandle_ShouldThrowPlatformNotSupportedExceptionOnWindows(94c9f23f-795f-4c31-9d3b-cd1b58baeef0)
Testably.Abstractions.Testing.Tests.FileSystem.FileMockTests ‑ GetUnixFileMode_SafeFileHandle_ShouldThrowPlatformNotSupportedExceptionOnWindows(b5502537-056b-4722-8dc2-c77df95b5bf2)
Testably.Abstractions.Testing.Tests.FileSystem.FileMockTests ‑ GetUnixFileMode_SafeFileHandle_ShouldThrowPlatformNotSupportedExceptionOnWindows(fcd6246f-044f-474d-aaa6-cc3220969eff)
Testably.Abstractions.Testing.Tests.FileSystem.FileMockTests ‑ SetUnixFileMode_SafeFileHandle_ShouldUpdateValue(7f1ab2f8-833b-4141-91da-4b7a9d1899d5, None)
Testably.Abstractions.Testing.Tests.FileSystem.FileMockTests ‑ SetUnixFileMode_SafeFileHandle_ShouldUpdateValue(8604dff0-1654-4681-b766-4eeda3f83a80, None)
…
Testably.Abstractions.Testing.Tests.FileSystem.FileMockTests ‑ GetUnixFileMode_SafeFileHandle_ShouldThrowPlatformNotSupportedExceptionOnWindows(0701d923-f086-45e2-bdd3-cfe672ff369c)
Testably.Abstractions.Testing.Tests.FileSystem.FileMockTests ‑ GetUnixFileMode_SafeFileHandle_ShouldThrowPlatformNotSupportedExceptionOnWindows(12d7371e-5b54-4600-b538-48eb3770b0bd)
Testably.Abstractions.Testing.Tests.FileSystem.FileMockTests ‑ GetUnixFileMode_SafeFileHandle_ShouldThrowPlatformNotSupportedExceptionOnWindows(1df22e7d-c19f-46b1-9811-16bfca8d275f)
Testably.Abstractions.Testing.Tests.FileSystem.FileMockTests ‑ GetUnixFileMode_SafeFileHandle_ShouldThrowPlatformNotSupportedExceptionOnWindows(277b33b4-15e8-4ae6-9ef6-79eacbf24472)
Testably.Abstractions.Testing.Tests.FileSystem.FileMockTests ‑ GetUnixFileMode_SafeFileHandle_ShouldThrowPlatformNotSupportedExceptionOnWindows(bbaa5ac6-d992-42f5-bb75-a4a4958cbd92)
Testably.Abstractions.Testing.Tests.FileSystem.FileMockTests ‑ GetUnixFileMode_SafeFileHandle_ShouldThrowPlatformNotSupportedExceptionOnWindows(c6a67de5-3c67-4ddb-8427-465c3624cbfd)
Testably.Abstractions.Testing.Tests.FileSystem.FileMockTests ‑ GetUnixFileMode_SafeFileHandle_ShouldThrowPlatformNotSupportedExceptionOnWindows(cc602e3a-29a9-442c-a816-1e03acdbd47a)
Testably.Abstractions.Testing.Tests.FileSystem.FileMockTests ‑ GetUnixFileMode_SafeFileHandle_ShouldThrowPlatformNotSupportedExceptionOnWindows(d656d07a-f0a5-42ce-bbc9-524660f32dbd)
Testably.Abstractions.Testing.Tests.FileSystem.FileMockTests ‑ SetUnixFileMode_SafeFileHandle_ShouldUpdateValue(696f59d9-3c6f-4a10-8eb9-80d3dee4b3a9, None)
Testably.Abstractions.Testing.Tests.FileSystem.FileMockTests ‑ SetUnixFileMode_SafeFileHandle_ShouldUpdateValue(81fc4107-60bb-42d9-93da-25fe43d0e8cd, None)
…

♻️ This comment has been updated with latest results.

@sonarqubecloud

sonarqubecloud Bot commented Nov 4, 2026

Copy link
Copy Markdown

@vbreuss
vbreuss merged commit e17e04d into main Nov 4, 2026
14 checks passed
@vbreuss
vbreuss deleted the fix/hold-the-clock-while-a-callback-runs branch November 4, 2026 12:58
@github-actions

Copy link
Copy Markdown

This is addressed in release v8.0.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant