Skip to content

Remove timing assertion from oneshot::send_before_recv_timeout#152648

Open
JonathanBrouwer wants to merge 1 commit intorust-lang:mainfrom
JonathanBrouwer:debug_spurious
Open

Remove timing assertion from oneshot::send_before_recv_timeout#152648
JonathanBrouwer wants to merge 1 commit intorust-lang:mainfrom
JonathanBrouwer:debug_spurious

Conversation

@JonathanBrouwer
Copy link
Contributor

This test regularly spuriously fails in CI, such as #152632 (comment)
We can just remove the assertion but I'd like to understand why, so I'm adding more information to the assert

@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 Feb 15, 2026
@rustbot
Copy link
Collaborator

rustbot commented Feb 15, 2026

r? @jhpratt

rustbot has assigned @jhpratt.
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

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @ChrisDenton, libs
  • @ChrisDenton, libs expanded to 8 candidates
  • Random selection from Mark-Simulacrum, jhpratt, joboet

@jieyouxu
Copy link
Member

Is there anything we can do for this test to make it less likely to spuriously fail? (Not really for this PR, but yeah I've seen it fail quite often.)

@JonathanBrouwer
Copy link
Contributor Author

JonathanBrouwer commented Feb 15, 2026

I don't know fully how these tests work, my guess is that all the tests run in parallel threads and this thread yields and just isn't scheduled for a while., therefore hitting the timeout. I wanted to increase the timeout to fix that but this PR is adding more information to know what to increase the timeout to.

We can also just remove the assertion if we want to be done with it, but that doesn't feel right

@jhpratt
Copy link
Member

jhpratt commented Feb 15, 2026

Can't hurt to have a bit of instrumentation to narrow things down. Prioritizing given the spuriousness of it.

@bors r+ rollup p=1

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 15, 2026

📌 Commit d5a1a7a has been approved by jhpratt

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 Feb 15, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Feb 15, 2026
…jhpratt

Add information to spurious `oneshot::send_before_recv_timeout` test

This test regularly spuriously fails in CI, such as rust-lang#152632 (comment)
We can just remove the assertion but I'd like to understand why, so I'm adding more information to the assert
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Feb 15, 2026
…jhpratt

Add information to spurious `oneshot::send_before_recv_timeout` test

This test regularly spuriously fails in CI, such as rust-lang#152632 (comment)
We can just remove the assertion but I'd like to understand why, so I'm adding more information to the assert
@Zalathar
Copy link
Member

In #152145, a similar test oneshot::recv_timeout_before_send was disabled for being inherently flaky, because there was no guarantee that the sender thread would actually send before the receiver thread timed out.

This test also appears to be inherently flaky, for a related but sillier reason.

Note that the failing assertion is the final line, assert!(start.elapsed() < timeout). Even if the receive succeeds (which it should), there's no guarantee that the assertion is performed before 1 second is elapsed.

All it takes is for that assertion to fail is for the CI runner to be descheduled for 1 second or longer, at any point after the initial let start = Instant::now().

@JonathanBrouwer
Copy link
Contributor Author

Ah, I was thinking something similar but I was like "there is no way a thread isn't scheduled for a full second".
Given these other tests I think it is indeed best just to ignore the test

@rust-bors rust-bors bot 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Feb 15, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 15, 2026

⚠️ A new commit cbe63ddd9a0ddedb3b32b902ad0dc39db1593144 was pushed to the branch, the PR will need to be re-approved.

@JonathanBrouwer JonathanBrouwer changed the title Add information to spurious oneshot::send_before_recv_timeout test Ignore oneshot::send_before_recv_timeout Feb 15, 2026
@JonathanBrouwer
Copy link
Contributor Author

I disabled the test, similar to the other PR

@JonathanBrouwer
Copy link
Contributor Author

Hmmm pushing a new commit does not unapprove the rollup, interesting

@Zalathar
Copy link
Member

In this case, I believe we should be able to keep the test and only get rid of the timing assertion.

@JonathanBrouwer JonathanBrouwer changed the title Ignore oneshot::send_before_recv_timeout Remove timing assertion from oneshot::send_before_recv_timeout Feb 15, 2026
@JonathanBrouwer
Copy link
Contributor Author

Fixed :)

@rust-log-analyzer

This comment has been minimized.

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

Labels

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants