std::rt: Use a constant 4 threads for multithreaded sched tests. #7772
Too much overcommit here exhausts the low fd limit on OS X.
This commit is contained in:
parent
93c270c63d
commit
49b72bdd77
@ -64,7 +64,6 @@ pub fn run_in_mt_newsched_task(f: ~fn()) {
|
|||||||
use os;
|
use os;
|
||||||
use from_str::FromStr;
|
use from_str::FromStr;
|
||||||
use rt::sched::Shutdown;
|
use rt::sched::Shutdown;
|
||||||
use rt::util;
|
|
||||||
|
|
||||||
let f_cell = Cell::new(f);
|
let f_cell = Cell::new(f);
|
||||||
|
|
||||||
@ -72,10 +71,10 @@ pub fn run_in_mt_newsched_task(f: ~fn()) {
|
|||||||
let nthreads = match os::getenv("RUST_TEST_THREADS") {
|
let nthreads = match os::getenv("RUST_TEST_THREADS") {
|
||||||
Some(nstr) => FromStr::from_str(nstr).get(),
|
Some(nstr) => FromStr::from_str(nstr).get(),
|
||||||
None => {
|
None => {
|
||||||
// Using more threads than cores in test code
|
// A reasonable number of threads for testing
|
||||||
// to force the OS to preempt them frequently.
|
// multithreading. NB: It's easy to exhaust OS X's
|
||||||
// Assuming that this help stress test concurrent types.
|
// low maximum fd limit by setting this too high (#7772)
|
||||||
util::num_cpus() * 2
|
4
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user