]> git.lizzy.rs Git - rust.git/commitdiff
libcore: Use 4x the number of scheduler threads for testing
authorBrian Anderson <banderson@mozilla.com>
Thu, 19 Jan 2012 22:43:56 +0000 (14:43 -0800)
committerBrian Anderson <banderson@mozilla.com>
Fri, 20 Jan 2012 01:54:21 +0000 (17:54 -0800)
An arbitrary number. I've done no measurements but it's intended to overcome
the effects of tasks randomly being scheduled to threads and no work stealing.

If scheduler threads == 1 then we just use a single test task.

src/compiletest/compiletest.rs
src/libstd/test.rs

index ccbafa0f1591af79f512f5263299c9dc21194ac1..a86a94547f736a4fe308a8b1622c3b56076aa0ae 100644 (file)
@@ -187,7 +187,6 @@ fn make_test_closure(cx: cx, testfile: str) -> test::test_fn {
 fn run_test_task(config: common::config,
                  procsrv_chan: procsrv::reqchan,
                  testfile: str) {
-    test::configure_test_task();
 
     let procsrv = procsrv::from_chan(procsrv_chan);
     let cx = {config: config, procsrv: procsrv};
index 88601ebb19e0b9d73748b1a2c9d254c823012be0..7fc63c015ee574326af51f1fbe1350d8e8553a8a 100644 (file)
@@ -227,7 +227,11 @@ fn run_tests(opts: test_opts, tests: [test_desc],
     }
 }
 
-fn get_concurrency() -> uint { rustrt::sched_threads() }
+fn get_concurrency() -> uint {
+    let threads = rustrt::sched_threads();
+    if threads == 1u { 1u }
+    else { threads * 4u }
+}
 
 fn filter_tests(opts: test_opts,
                 tests: [test_desc]) -> [test_desc] {