let f_cell = Cell::new(f);
do run_in_bare_thread {
- let nthreads = match os::getenv("RUST_TEST_THREADS") {
+ let nthreads = match os::getenv("RUST_RT_TEST_THREADS") {
Some(nstr) => FromStr::from_str(nstr).get(),
None => {
- // Using more threads than cores in test code
- // to force the OS to preempt them frequently.
- // Assuming that this help stress test concurrent types.
- util::num_cpus() * 2
+ // A reasonable number of threads for testing
+ // multithreading. NB: It's easy to exhaust OS X's
+ // low maximum fd limit by setting this too high (#7772)
+ 4
}
};