Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion library/test/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,14 @@ pub fn run_test(
let supports_threads = !cfg!(target_os = "emscripten") && !cfg!(target_arch = "wasm32");
if concurrency == Concurrent::Yes && supports_threads {
let cfg = thread::Builder::new().name(name.as_slice().to_owned());
cfg.spawn(runtest).unwrap();
if let Err(err) = cfg.spawn(runtest) {
if err.kind() == io::ErrorKind::WouldBlock {
// If we're at the thread limit, just run all tests in a single thread.
runtest();
} else {
panic!("spawning a test thread failed: {}", err);
}
}
} else {
runtest();
}
Expand Down