Skip to content

Commit 6d4884d

Browse files
committed
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.
1 parent 928e558 commit 6d4884d

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/compiletest/compiletest.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@ fn make_test_closure(cx: cx, testfile: str) -> test::test_fn {
187187
fn run_test_task(config: common::config,
188188
procsrv_chan: procsrv::reqchan,
189189
testfile: str) {
190-
test::configure_test_task();
191190

192191
let procsrv = procsrv::from_chan(procsrv_chan);
193192
let cx = {config: config, procsrv: procsrv};

src/libstd/test.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,11 @@ fn run_tests(opts: test_opts, tests: [test_desc],
227227
}
228228
}
229229

230-
fn get_concurrency() -> uint { rustrt::sched_threads() }
230+
fn get_concurrency() -> uint {
231+
let threads = rustrt::sched_threads();
232+
if threads == 1u { 1u }
233+
else { threads * 4u }
234+
}
231235

232236
fn filter_tests(opts: test_opts,
233237
tests: [test_desc]) -> [test_desc] {

0 commit comments

Comments
 (0)