libcore: Use 4x the number of scheduler threads for testing

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.
This commit is contained in:
Brian Anderson 2012-01-19 14:43:56 -08:00
parent 928e55815c
commit 6d4884d983
2 changed files with 5 additions and 2 deletions

View 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};

View 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] {