Skip to content

Commit 7b38d8f

Browse files
committed
Try to fix for 1.15 again
1 parent 0a0b2d5 commit 7b38d8f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/mpsc-close.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ fn stress_try_send_as_receiver_closes() {
3737
// When we detect that a successfully sent item is still in the
3838
// queue after a disconnect, we spin for up to 100ms to confirm that
3939
// it is a persistent condition and not a concurrency illusion.
40-
const SPIN_TIMEOUT: Duration = Duration::from_secs(10);
41-
const SPIN_SLEEP: Duration = Duration::from_millis(10);
40+
const SPIN_TIMEOUT_S: u64 = 10;
41+
const SPIN_SLEEP_MS: u64 = 10;
4242
struct TestRx {
4343
rx: Receiver<Arc<()>>,
4444
// The number of times to query `rx` before dropping it.
@@ -128,13 +128,13 @@ fn stress_try_send_as_receiver_closes() {
128128
if prev_weak.upgrade().is_none() {
129129
break;
130130
}
131-
assert!(t0.elapsed() < SPIN_TIMEOUT,
131+
assert!(t0.elapsed() < Duration::from_secs(SPIN_TIMEOUT_S),
132132
"item not dropped on iteration {} after \
133133
{} sends ({} successful). spin=({})",
134134
i, attempted_sends, successful_sends, spins
135135
);
136136
spins += 1;
137-
thread::sleep(SPIN_SLEEP);
137+
thread::sleep(Duration::from_millis(SPIN_SLEEP_MS));
138138
}
139139
}
140140
}

0 commit comments

Comments
 (0)