Skip to content

Conversation

@PaulDance
Copy link
Contributor

@PaulDance PaulDance commented Jan 8, 2026

Fixes #149935. See the added comment for more details.

This makes the concerned test now reproducibly pass, for us at least. Also, testing this separately revealed successful: see the issue.

@rustbot label C-bug I-flaky-test O-windows-7 T-libs A-time A-thread

… duration under Win7

Fixes rust-lang#149935. See the added comment for more details.

Signed-off-by: Paul Mabileau <[email protected]>
@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-libs Relevant to the library team, which will review and decide on the PR/issue. A-thread Area: `std::thread` A-time Area: Time C-bug Category: This is a bug. I-flaky-test Issue: A test is flaky/unreliable/spuriously fails O-windows-7 OS: Windows 7 or Windows Server 2008 R2 or etc. labels Jan 8, 2026
@PaulDance PaulDance marked this pull request as ready for review January 8, 2026 23:49
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 8, 2026
@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jan 8, 2026
@rustbot
Copy link
Collaborator

rustbot commented Jan 8, 2026

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot
Copy link
Collaborator

rustbot commented Jan 8, 2026

⚠️ Warning ⚠️

  • There are issue links (such as #123) in the commit messages of the following commits.
    Please move them to the PR description, to avoid spamming the issues with references to the commit, and so this bot can automatically canonicalize them to avoid issues with subtree.

@PaulDance
Copy link
Contributor Author

@ChrisDenton might also be interested, as the initial discussion involved him.

@joshtriplett
Copy link
Member

We discussed this in today's @rust-lang/libs-api meeting. We're okay doing this on win7.

In general, we do want to keep the "at-least" guarantee, to the extent possible. I suggested in the meeting that we wouldn't want to preserve that guarantee if a mainstream platform required us to make an extra syscall on every sleep. But as long as mainstream platforms either do this correctly by default or return something we can check without a syscall, that's fine.

@Mark-Simulacrum
Copy link
Member

@bors r+

@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 24, 2026

📌 Commit eb101b1 has been approved by Mark-Simulacrum

It is now in the queue for this repository.

@rust-bors rust-bors bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 24, 2026
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jan 24, 2026
…r=Mark-Simulacrum

Fix(lib/win/thread): Ensure `Sleep`'s usage passes over the requested duration under Win7

Fixes rust-lang#149935. See the added comment for more details.

This makes the concerned test now reproducibly pass, for us at least. Also, testing this separately revealed successful: see the issue.

@rustbot label C-bug I-flaky-test O-windows-7 T-libs A-time A-thread
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jan 24, 2026
…r=Mark-Simulacrum

Fix(lib/win/thread): Ensure `Sleep`'s usage passes over the requested duration under Win7

Fixes rust-lang#149935. See the added comment for more details.

This makes the concerned test now reproducibly pass, for us at least. Also, testing this separately revealed successful: see the issue.

@rustbot label C-bug I-flaky-test O-windows-7 T-libs A-time A-thread
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jan 24, 2026
…r=Mark-Simulacrum

Fix(lib/win/thread): Ensure `Sleep`'s usage passes over the requested duration under Win7

Fixes rust-lang#149935. See the added comment for more details.

This makes the concerned test now reproducibly pass, for us at least. Also, testing this separately revealed successful: see the issue.

@rustbot label C-bug I-flaky-test O-windows-7 T-libs A-time A-thread
rust-bors bot pushed a commit that referenced this pull request Jan 25, 2026
Rollup of 8 pull requests

Successful merges:

 - #145393 (Add codegen test for removing trailing zeroes from `NonZero`)
 - #149869 (std: avoid tearing `dbg!` prints)
 - #150065 (add CSE optimization tests for iterating over slice)
 - #150842 (Fix(lib/win/thread): Ensure `Sleep`'s usage passes over the requested duration under Win7)
 - #151244 (Refine dummy_span.rs test)
 - #151505 (Various refactors to the proc_macro bridge)
 - #151560 (relnotes: fix 1.93's `as_mut_array` methods)
 - #151577 (Rename `DepKindStruct` to `DepKindVTable`)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jan 25, 2026
…r=Mark-Simulacrum

Fix(lib/win/thread): Ensure `Sleep`'s usage passes over the requested duration under Win7

Fixes rust-lang#149935. See the added comment for more details.

This makes the concerned test now reproducibly pass, for us at least. Also, testing this separately revealed successful: see the issue.

@rustbot label C-bug I-flaky-test O-windows-7 T-libs A-time A-thread
rust-bors bot pushed a commit that referenced this pull request Jan 25, 2026
…uwer

Rollup of 11 pull requests

Successful merges:

 - #145393 (Add codegen test for removing trailing zeroes from `NonZero`)
 - #148764 (ptr_aligment_type: add more APIs)
 - #149869 (std: avoid tearing `dbg!` prints)
 - #150065 (add CSE optimization tests for iterating over slice)
 - #150842 (Fix(lib/win/thread): Ensure `Sleep`'s usage passes over the requested duration under Win7)
 - #151505 (Various refactors to the proc_macro bridge)
 - #151560 (relnotes: fix 1.93's `as_mut_array` methods)
 - #151611 (Improve is_ascii performance on x86_64 with explicit SSE2 intrinsics)
 - #151317 (x86 soft-float feature: mark it as forbidden rather than unstable)
 - #151577 (Rename `DepKindStruct` to `DepKindVTable`)
 - #151620 (Fix 'the the' typo in library/core/src/array/iter.rs)
rust-bors bot pushed a commit that referenced this pull request Jan 25, 2026
Rollup of 10 pull requests

Successful merges:

 - #145393 (Add codegen test for removing trailing zeroes from `NonZero`)
 - #148764 (ptr_aligment_type: add more APIs)
 - #149869 (std: avoid tearing `dbg!` prints)
 - #150065 (add CSE optimization tests for iterating over slice)
 - #150842 (Fix(lib/win/thread): Ensure `Sleep`'s usage passes over the requested duration under Win7)
 - #151505 (Various refactors to the proc_macro bridge)
 - #151560 (relnotes: fix 1.93's `as_mut_array` methods)
 - #151317 (x86 soft-float feature: mark it as forbidden rather than unstable)
 - #151577 (Rename `DepKindStruct` to `DepKindVTable`)
 - #151620 (Fix 'the the' typo in library/core/src/array/iter.rs)
@rust-bors rust-bors bot merged commit 3850473 into rust-lang:main Jan 25, 2026
11 checks passed
@rustbot rustbot added this to the 1.95.0 milestone Jan 25, 2026
rust-timer added a commit that referenced this pull request Jan 25, 2026
Rollup merge of #150842 - PaulDance:patches/fix-win7-sleep, r=Mark-Simulacrum

Fix(lib/win/thread): Ensure `Sleep`'s usage passes over the requested duration under Win7

Fixes #149935. See the added comment for more details.

This makes the concerned test now reproducibly pass, for us at least. Also, testing this separately revealed successful: see the issue.

@rustbot label C-bug I-flaky-test O-windows-7 T-libs A-time A-thread
@PaulDance PaulDance deleted the patches/fix-win7-sleep branch January 25, 2026 20:38
@PaulDance
Copy link
Contributor Author

Thanks!

github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Jan 26, 2026
Rollup of 10 pull requests

Successful merges:

 - rust-lang/rust#145393 (Add codegen test for removing trailing zeroes from `NonZero`)
 - rust-lang/rust#148764 (ptr_aligment_type: add more APIs)
 - rust-lang/rust#149869 (std: avoid tearing `dbg!` prints)
 - rust-lang/rust#150065 (add CSE optimization tests for iterating over slice)
 - rust-lang/rust#150842 (Fix(lib/win/thread): Ensure `Sleep`'s usage passes over the requested duration under Win7)
 - rust-lang/rust#151505 (Various refactors to the proc_macro bridge)
 - rust-lang/rust#151560 (relnotes: fix 1.93's `as_mut_array` methods)
 - rust-lang/rust#151317 (x86 soft-float feature: mark it as forbidden rather than unstable)
 - rust-lang/rust#151577 (Rename `DepKindStruct` to `DepKindVTable`)
 - rust-lang/rust#151620 (Fix 'the the' typo in library/core/src/array/iter.rs)
lnicola pushed a commit to lnicola/rust-analyzer that referenced this pull request Jan 27, 2026
Rollup of 10 pull requests

Successful merges:

 - rust-lang/rust#145393 (Add codegen test for removing trailing zeroes from `NonZero`)
 - rust-lang/rust#148764 (ptr_aligment_type: add more APIs)
 - rust-lang/rust#149869 (std: avoid tearing `dbg!` prints)
 - rust-lang/rust#150065 (add CSE optimization tests for iterating over slice)
 - rust-lang/rust#150842 (Fix(lib/win/thread): Ensure `Sleep`'s usage passes over the requested duration under Win7)
 - rust-lang/rust#151505 (Various refactors to the proc_macro bridge)
 - rust-lang/rust#151560 (relnotes: fix 1.93's `as_mut_array` methods)
 - rust-lang/rust#151317 (x86 soft-float feature: mark it as forbidden rather than unstable)
 - rust-lang/rust#151577 (Rename `DepKindStruct` to `DepKindVTable`)
 - rust-lang/rust#151620 (Fix 'the the' typo in library/core/src/array/iter.rs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-thread Area: `std::thread` A-time Area: Time C-bug Category: This is a bug. I-flaky-test Issue: A test is flaky/unreliable/spuriously fails O-windows-7 OS: Windows 7 or Windows Server 2008 R2 or etc. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The thread::sleep_until test frequently fails under Windows 7

5 participants