Skip to content

Commit 2408436

Browse files
committed
test: Make two tests less flaky on windows
If these tests exit while a thread is panicking it often leads to situations like #22628.
1 parent f0f7ca2 commit 2408436

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/test/run-pass/unwind-resource.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ fn f(tx: Sender<bool>) {
3737

3838
pub fn main() {
3939
let (tx, rx) = channel();
40-
let _t = thread::spawn(move|| f(tx.clone()));
40+
let t = thread::spawn(move|| f(tx.clone()));
4141
println!("hiiiiiiiii");
4242
assert!(rx.recv().unwrap());
43+
drop(t.join());
4344
}

src/test/run-pass/unwind-unique.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@ fn f() {
1919
}
2020

2121
pub fn main() {
22-
let _t = thread::spawn(f);
22+
let t = thread::spawn(f);
23+
drop(t.join());
2324
}

0 commit comments

Comments
 (0)