We can configure the test runner concurrency by using either the --test-threads parameter, or by setting the environment variable RUST_TEST_THREADS:
|
let concurrency = opts.test_threads.unwrap_or_else(get_concurrency); |
As some tests might need to read the current concurrency configuration, the only way to do this currently is by reading the said environment variable. However, if we use --test-threads, this information is not passed further to tests. I think this behaviour is a bit inconsistent and the env var should be always set to the actual value, e.g.:
let concurrency = opts.test_threads.unwrap_or_else(get_concurrency);
env::set_var("RUST_TEST_THREADS", concurrency.to_string());
We can configure the test runner concurrency by using either the
--test-threadsparameter, or by setting the environment variableRUST_TEST_THREADS:rust/src/libtest/lib.rs
Line 245 in efc02b0
As some tests might need to read the current concurrency configuration, the only way to do this currently is by reading the said environment variable. However, if we use
--test-threads, this information is not passed further to tests. I think this behaviour is a bit inconsistent and the env var should be always set to the actual value, e.g.: