Rollup merge of #153534 - Zalathar:flaky-stress, r=Mark-Simulacrum

Remove a flaky `got_timeout` assert from two channel tests

In CI, the receiver thread can be descheduled for a surprisingly long time, so there's no guarantee that a timeout actually occurs.

One of these tests actually failed in https://github.com/rust-lang/rust/pull/153387#issuecomment-4016078983.

Earlier failures:
- https://github.com/rust-lang/rust/pull/150365#issuecomment-3691457455
- https://github.com/rust-lang/rust/pull/147775#issuecomment-3410454391

---

- Prior art: https://github.com/rust-lang/rust/pull/152878
This commit is contained in:
Jonathan Brouwer
2026-03-23 12:14:53 +01:00
committed by GitHub
2 changed files with 0 additions and 6 deletions
-3
View File
@@ -475,7 +475,6 @@ fn stress_recv_timeout_two_threads() {
});
let mut recv_count = 0;
let mut got_timeout = false;
loop {
match rx.recv_timeout(timeout) {
Ok(n) => {
@@ -483,7 +482,6 @@ fn stress_recv_timeout_two_threads() {
recv_count += 1;
}
Err(RecvTimeoutError::Timeout) => {
got_timeout = true;
continue;
}
Err(RecvTimeoutError::Disconnected) => break,
@@ -491,7 +489,6 @@ fn stress_recv_timeout_two_threads() {
}
assert_eq!(recv_count, stress);
assert!(got_timeout);
}
#[test]
-3
View File
@@ -438,7 +438,6 @@ fn stress_recv_timeout_two_threads() {
});
let mut recv_count = 0;
let mut got_timeout = false;
loop {
match rx.recv_timeout(timeout) {
Ok(n) => {
@@ -446,7 +445,6 @@ fn stress_recv_timeout_two_threads() {
recv_count += 1;
}
Err(RecvTimeoutError::Timeout) => {
got_timeout = true;
continue;
}
Err(RecvTimeoutError::Disconnected) => break,
@@ -454,7 +452,6 @@ fn stress_recv_timeout_two_threads() {
}
assert_eq!(recv_count, stress);
assert!(got_timeout);
}
#[test]