Skip to content

fix: measure a mocked timer's due time from when it is started - #1169

Merged
vbreuss merged 1 commit into
mainfrom
fix/timer-due-time-anchor
Oct 30, 2026
Merged

vbreuss merged 1 commit into
mainfrom
fix/timer-due-time-anchor

Conversation

@vbreuss

@vbreuss vbreuss commented Oct 30, 2026

Copy link
Copy Markdown
Member

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.

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.
@vbreuss vbreuss self-assigned this Oct 30, 2026
Copilot AI balanced review requested due to automatic review settings October 30, 2026 07:04

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@sonarqubecloud

Copy link
Copy Markdown

@mergify

mergify Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

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.

@github-actions

Copy link
Copy Markdown

Test Results

     62 files  ±0       62 suites  ±0   1h 17m 35s ⏱️ + 2m 34s
 66 194 tests +1   62 682 ✅ +1   3 512 💤 ±0  0 ❌ ±0 
151 386 runs  ±0  136 616 ✅ ±0  14 770 💤 ±0  0 ❌ ±0 

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.
  )
)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(14baa4e9-70a9-449b-a40f-bcf29cff42dd)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(1ffc359f-8000-488c-98c1-c07a43c14308)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(3342e179-e725-4ef4-909c-f8281e68e96f)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(37b5317c-fe2f-4cdd-92d9-7ef02dfb7ac1)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(4369ef53-4990-441f-9781-e59897343682)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(66a09c8e-a7fb-4f48-a979-bce0534aced2)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(806ada1a-37a2-42ec-a9ee-c8841aa613fa)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(9eed6268-e472-4724-ad2c-aa3bcf990ba7)
…
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(0f211e06-e5d7-4f49-999c-91595f39b288)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(2fb3f9ee-8e52-4916-812f-4a362e787b31)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(33e6b1e1-6573-448e-a7c5-6d87c50aefa1)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(4a2658f3-7151-4f49-9f14-eb8bae9178ec)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(524baf39-463b-4132-819d-b053b65cbdb2)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(57e45697-10bc-49aa-82f1-6be4197cb825)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(5f4aa7fc-0f8b-475d-b6f9-aed2508f04db)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(61a28d3d-b84e-4e98-aa27-a16ac5913842)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(61c0ebf0-6706-4f4b-bce0-586e3ed06fd6)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(7272eb01-b26a-46ec-b970-8762ebeb0859)
…
This pull request removes 3484 skipped tests and adds 3484 skipped tests. Note that renamed tests count towards both.
Testably.Abstractions.Testing.Tests.FileSystem.FileMockTests ‑ GetUnixFileMode_SafeFileHandle_ShouldThrowPlatformNotSupportedExceptionOnWindows(1494bc72-5ffa-47ac-8e27-e261015d8d4d)
Testably.Abstractions.Testing.Tests.FileSystem.FileMockTests ‑ GetUnixFileMode_SafeFileHandle_ShouldThrowPlatformNotSupportedExceptionOnWindows(3aa11bb6-937b-47a3-8723-446b10c3811c)
Testably.Abstractions.Testing.Tests.FileSystem.FileMockTests ‑ GetUnixFileMode_SafeFileHandle_ShouldThrowPlatformNotSupportedExceptionOnWindows(4745d39f-40f2-4b46-a8e5-3596c90b894b)
Testably.Abstractions.Testing.Tests.FileSystem.FileMockTests ‑ GetUnixFileMode_SafeFileHandle_ShouldThrowPlatformNotSupportedExceptionOnWindows(a72b17b3-314c-4f52-8004-5cfbd5c9af22)
Testably.Abstractions.Testing.Tests.FileSystem.FileMockTests ‑ GetUnixFileMode_SafeFileHandle_ShouldThrowPlatformNotSupportedExceptionOnWindows(c6d2434d-2612-4bed-a92d-d5b16f226b71)
Testably.Abstractions.Testing.Tests.FileSystem.FileMockTests ‑ GetUnixFileMode_SafeFileHandle_ShouldThrowPlatformNotSupportedExceptionOnWindows(f22dd0dd-540e-4db6-be3d-ff0cee4d3ef9)
Testably.Abstractions.Testing.Tests.FileSystem.FileMockTests ‑ SetUnixFileMode_SafeFileHandle_ShouldUpdateValue(359ae5dc-65d0-40f8-be7c-f51c9ec344fc, None)
Testably.Abstractions.Testing.Tests.FileSystem.FileMockTests ‑ SetUnixFileMode_SafeFileHandle_ShouldUpdateValue(947c3d3a-70b7-49fb-aa39-6fedfc5e2b3c, None)
Testably.Abstractions.Testing.Tests.FileSystem.FileMockTests ‑ SetUnixFileMode_SafeFileHandle_ShouldUpdateValue(e7292f69-bb03-4185-a050-a7ae5463e81a, None)
Testably.Abstractions.Testing.Tests.FileSystem.FileStreamFactoryMockTests ‑ New_ShouldSetUnixFileMode(Append, 8303e341-cd70-420f-a074-d7afaef29952)
…
Testably.Abstractions.Testing.Tests.FileSystem.FileMockTests ‑ GetUnixFileMode_SafeFileHandle_ShouldThrowPlatformNotSupportedExceptionOnWindows(52a8f910-4eb1-4ccd-aba1-c0cf20dbee14)
Testably.Abstractions.Testing.Tests.FileSystem.FileMockTests ‑ GetUnixFileMode_SafeFileHandle_ShouldThrowPlatformNotSupportedExceptionOnWindows(61b76805-6cc2-491a-bbb3-7a3871b4fbf3)
Testably.Abstractions.Testing.Tests.FileSystem.FileMockTests ‑ GetUnixFileMode_SafeFileHandle_ShouldThrowPlatformNotSupportedExceptionOnWindows(7ad1bf45-b324-4823-85b8-6722e4d766a3)
Testably.Abstractions.Testing.Tests.FileSystem.FileMockTests ‑ GetUnixFileMode_SafeFileHandle_ShouldThrowPlatformNotSupportedExceptionOnWindows(9ed87bbc-4cd8-4bef-b75a-749d351d4624)
Testably.Abstractions.Testing.Tests.FileSystem.FileMockTests ‑ GetUnixFileMode_SafeFileHandle_ShouldThrowPlatformNotSupportedExceptionOnWindows(a04c9284-c5dd-476c-ae76-450ef6265445)
Testably.Abstractions.Testing.Tests.FileSystem.FileMockTests ‑ GetUnixFileMode_SafeFileHandle_ShouldThrowPlatformNotSupportedExceptionOnWindows(b88c9dab-b49f-46a4-993d-9df2af7f0229)
Testably.Abstractions.Testing.Tests.FileSystem.FileMockTests ‑ SetUnixFileMode_SafeFileHandle_ShouldUpdateValue(19a9c086-28b8-4653-b593-c5e46342442d, None)
Testably.Abstractions.Testing.Tests.FileSystem.FileMockTests ‑ SetUnixFileMode_SafeFileHandle_ShouldUpdateValue(343d8eca-7280-427d-af8d-30086f943dcf, None)
Testably.Abstractions.Testing.Tests.FileSystem.FileMockTests ‑ SetUnixFileMode_SafeFileHandle_ShouldUpdateValue(c79c8f5a-2ad0-4d04-9bb6-e824349fb165, None)
Testably.Abstractions.Testing.Tests.FileSystem.FileStreamFactoryMockTests ‑ New_ShouldSetUnixFileMode(Append, 19dfd2fa-722f-44c7-8ba6-e531ab75414d)
…

@vbreuss
vbreuss merged commit 151f18d into main Oct 30, 2026
14 checks passed
@vbreuss
vbreuss deleted the fix/timer-due-time-anchor branch October 30, 2026 08:03
@github-actions

Copy link
Copy Markdown

This is addressed in release v7.2.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.

2 participants