]> git.lizzy.rs Git - rust.git/commitdiff
auto merge of #7855 : brson/rust/rt-overcommit, r=pcwalton
authorbors <bors@rust-lang.org>
Sat, 20 Jul 2013 07:37:42 +0000 (00:37 -0700)
committerbors <bors@rust-lang.org>
Sat, 20 Jul 2013 07:37:42 +0000 (00:37 -0700)
Too much overcommit here exhausts the low fd limit on OS X.

1  2 
src/libstd/rt/test.rs

index e5393c84a088cfa9a377b59a48baa333b9db3e10,70620cf59da24c67d9f2f9dcf8e42af7cebd6acf..b568705245f2493028eeee69fafa75a8e4013989
@@@ -69,13 -68,13 +68,13 @@@ pub fn run_in_mt_newsched_task(f: ~fn()
      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
              }
          };