Skip to content

Commit d4ba1ca

Browse files
committed
Auto merge of #23718 - alexcrichton:flaky-test, r=huonw
It's considered an error to access stdout while a process is being shut down, so tweak this test a bit to actually wait for the child thread to exit. This was discovered with a recent [snap-mac3 failure](http://buildbot.rust-lang.org/builders/snap3-mac/builds/164/steps/test/logs/stdio)
2 parents 2790184 + 02c6f6b commit d4ba1ca

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Diff for: src/test/run-pass/extern-call-deep2.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![feature(std_misc, libc)]
11+
#![feature(libc)]
1212

1313
extern crate libc;
14-
use std::thread::Thread;
14+
use std::thread;
1515

1616
mod rustrt {
1717
extern crate libc;
@@ -42,9 +42,9 @@ fn count(n: libc::uintptr_t) -> libc::uintptr_t {
4242
pub fn main() {
4343
// Make sure we're on a task with small Rust stacks (main currently
4444
// has a large stack)
45-
let _t = Thread::spawn(move|| {
45+
thread::scoped(move|| {
4646
let result = count(1000);
4747
println!("result = {}", result);
4848
assert_eq!(result, 1000);
49-
});
49+
}).join();
5050
}

0 commit comments

Comments
 (0)