Skip to content

Avoid a gratuitous 10s wait in a stress test #142224

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

joshtriplett
Copy link
Member

@joshtriplett joshtriplett commented Jun 9, 2025

stress_recv_timeout_two_threads, in the mpmc and mpsc testsuites, is a stress test of the recv_timeout function. This test processes and ignores timeouts, and just ensures that every sent value gets received. As such, the exact length of the timeouts is not critical, only that the timeout and sleep durations ensure that at least one timeout occurred.

The current tests have 100 iterations, half of which sleep for 200ms, causing the test to take 10s. This represents around 2/3rds of the total runtime of the library/std testsuite, and is the only standard library test that takes more than a second.

Reduce this to 50 iterations where half of them sleep for 10ms, causing the test to take 0.25s.

Add a check that at least one timeout occurred.

@rustbot
Copy link
Collaborator

rustbot commented Jun 9, 2025

r? @workingjubilee

rustbot has assigned @workingjubilee.
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 rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jun 9, 2025
`stress_recv_timeout_two_threads`, in the mpmc and mpsc testsuites,
is a stress test of the `recv_timeout` function. This test processes and
ignores timeouts, and just ensures that every sent value gets received.
As such, the exact length of the timeouts is not critical, only that
the timeout and sleep durations ensure that at least one timeout
occurred.

The current tests have 100 iterations, half of which sleep for 200ms,
causing the test to take 10s. This represents around 2/3rds of the
*total* runtime of the `library/std` testsuite.

Reduce this to 50 iterations where half of them sleep for 10ms, causing
the test to take 0.25s.

Add a check that at least one timeout occurred.
@joshtriplett joshtriplett force-pushed the remove-gratuitous-wait-in-stress-test branch from e363076 to 889f7cb Compare June 9, 2025 03:22
@workingjubilee
Copy link
Member

workingjubilee commented Jun 9, 2025

The biggest concern I have with this PR is possibly being really slow on certain CI jobs, so let's give it a whirl on those platforms.

@workingjubilee
Copy link
Member

@bors2 try

@rust-bors
Copy link

rust-bors bot commented Jun 9, 2025

⌛ Trying commit 889f7cb with merge 5dabf4b

To cancel the try build, run the command @bors2 try cancel.

rust-bors bot added a commit that referenced this pull request Jun 9, 2025
…-test, r=<try>

Avoid a gratuitous 10s wait in a stress test

`stress_recv_timeout_two_threads`, in the mpmc and mpsc testsuites, is a stress test of the `recv_timeout` function. This test processes and ignores timeouts, and just ensures that every sent value gets received. As such, the exact length of the timeouts is not critical, only that the timeout and sleep durations ensure that at least one timeout occurred.

The current tests have 100 iterations, half of which sleep for 200ms, causing the test to take 10s. This represents around 2/3rds of the *total* runtime of the `library/std` testsuite, and is the only standard library test that takes more than a second.

Reduce this to 50 iterations where half of them sleep for 10ms, causing the test to take 0.25s.

Add a check that at least one timeout occurred.

try-job: test-various
try-job: i686-gnu-1
try-job: i686-gnu-nopt-1
try-job: i686-gnu-nopt-2
try-job: i686-msvc-1
try-job: armhf-gnu
try-job: arm-android
try-job: aarch64-gnu-debug
try-job: x86_64-gnu-debug
@rust-bors
Copy link

rust-bors bot commented Jun 9, 2025

💔 Test failed

@workingjubilee
Copy link
Member

That's... weird.

@joshtriplett Can you try rebasing this on latest and rerunning the try-jobs?

@joshtriplett
Copy link
Member Author

@workingjubilee It's already based on the latest HEAD.

As far as I can tell, the try failures look spurious?

@workingjubilee
Copy link
Member

huh.

Let's give it another go.

@bors2 try

@rust-bors
Copy link

rust-bors bot commented Jun 9, 2025

⌛ Trying commit 889f7cb with merge 35fc3f0

To cancel the try build, run the command @bors2 try cancel.

rust-bors bot added a commit that referenced this pull request Jun 9, 2025
…-test, r=<try>

Avoid a gratuitous 10s wait in a stress test

`stress_recv_timeout_two_threads`, in the mpmc and mpsc testsuites, is a stress test of the `recv_timeout` function. This test processes and ignores timeouts, and just ensures that every sent value gets received. As such, the exact length of the timeouts is not critical, only that the timeout and sleep durations ensure that at least one timeout occurred.

The current tests have 100 iterations, half of which sleep for 200ms, causing the test to take 10s. This represents around 2/3rds of the *total* runtime of the `library/std` testsuite, and is the only standard library test that takes more than a second.

Reduce this to 50 iterations where half of them sleep for 10ms, causing the test to take 0.25s.

Add a check that at least one timeout occurred.

try-job: test-various
try-job: i686-gnu-1
try-job: i686-gnu-nopt-1
try-job: i686-gnu-nopt-2
try-job: i686-msvc-1
try-job: armhf-gnu
try-job: arm-android
try-job: aarch64-gnu-debug
try-job: x86_64-gnu-debug
@rust-bors
Copy link

rust-bors bot commented Jun 9, 2025

💔 Test failed

@workingjubilee
Copy link
Member

...no, I don't believe this PR can be causing failures in run-make jobs, but also this test suite really ought to be passing.

@joshtriplett
Copy link
Member Author

@bors try

@bors
Copy link
Collaborator

bors commented Jun 9, 2025

⌛ Trying commit 889f7cb with merge f22aced...

bors added a commit that referenced this pull request Jun 9, 2025
…-test, r=<try>

Avoid a gratuitous 10s wait in a stress test

`stress_recv_timeout_two_threads`, in the mpmc and mpsc testsuites, is a stress test of the `recv_timeout` function. This test processes and ignores timeouts, and just ensures that every sent value gets received. As such, the exact length of the timeouts is not critical, only that the timeout and sleep durations ensure that at least one timeout occurred.

The current tests have 100 iterations, half of which sleep for 200ms, causing the test to take 10s. This represents around 2/3rds of the *total* runtime of the `library/std` testsuite, and is the only standard library test that takes more than a second.

Reduce this to 50 iterations where half of them sleep for 10ms, causing the test to take 0.25s.

Add a check that at least one timeout occurred.

try-job: test-various
try-job: i686-gnu-1
try-job: i686-gnu-nopt-1
try-job: i686-gnu-nopt-2
try-job: i686-msvc-1
try-job: armhf-gnu
try-job: arm-android
try-job: aarch64-gnu-debug
try-job: x86_64-gnu-debug
@bors
Copy link
Collaborator

bors commented Jun 9, 2025

💔 Test failed - checks-actions

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 9, 2025
@joshtriplett
Copy link
Member Author

Well, at least it doesn't seem to be a bors2 issue. Definitely looks spurious though.

@workingjubilee
Copy link
Member

@bors r+ into your hands, I commend my spirit

@bors
Copy link
Collaborator

bors commented Jun 9, 2025

📌 Commit 889f7cb has been approved by workingjubilee

It is now in the queue for this repository.

@bors bors 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 9, 2025
bors added a commit that referenced this pull request Jun 9, 2025
Rollup of 6 pull requests

Successful merges:

 - #141751 (Remap compiler vs non-compiler sources differently (bootstrap side))
 - #142160 (Only allow `bootstrap` cfg in rustc & related)
 - #142191 (early return in trait detection for non-trait item)
 - #142211 (Do not checkout GCC submodule for the tidy job)
 - #142218 (CI: rfl: move job forward to Linux v6.16-rc1)
 - #142224 (Avoid a gratuitous 10s wait in a stress test)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit bf17f13 into rust-lang:master Jun 9, 2025
10 of 11 checks passed
rust-timer added a commit that referenced this pull request Jun 9, 2025
Rollup merge of #142224 - joshtriplett:remove-gratuitous-wait-in-stress-test, r=workingjubilee

Avoid a gratuitous 10s wait in a stress test

`stress_recv_timeout_two_threads`, in the mpmc and mpsc testsuites, is a stress test of the `recv_timeout` function. This test processes and ignores timeouts, and just ensures that every sent value gets received. As such, the exact length of the timeouts is not critical, only that the timeout and sleep durations ensure that at least one timeout occurred.

The current tests have 100 iterations, half of which sleep for 200ms, causing the test to take 10s. This represents around 2/3rds of the *total* runtime of the `library/std` testsuite, and is the only standard library test that takes more than a second.

Reduce this to 50 iterations where half of them sleep for 10ms, causing the test to take 0.25s.

Add a check that at least one timeout occurred.
@rustbot rustbot added this to the 1.89.0 milestone Jun 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

4 participants