Run cargo test on both x86_64-linux and aarch64-darwin:
running 2 tests
test test::is_single_threaded ... FAILED
test test::num_threads ... FAILED
failures:
---- test::is_single_threaded stdout ----
thread 'test::is_single_threaded' panicked at 'assertion failed: `(left == right)`
left: `Some(false)`,
right: `Some(true)`', src/lib.rs:56:13
---- test::num_threads stdout ----
thread 'test::num_threads' panicked at 'assertion failed: `(left == right)`
left: `Some(3)`,
right: `Some(1)`', src/lib.rs:44:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
failures:
test::is_single_threaded
test::num_threads
Commenting out is_single_threaded, I'll see Some(2) from num_threads. So I guess that's because cargo or rustc has a main thread and the cases are executed in respective threads.
Can we specify RUST_TEST_THREADS=1 by some way in tests?
Run
cargo test
on bothx86_64-linux
andaarch64-darwin
:Commenting out
is_single_threaded
, I'll seeSome(2)
fromnum_threads
. So I guess that's becausecargo
orrustc
has a main thread and the cases are executed in respective threads.Can we specify
RUST_TEST_THREADS=1
by some way in tests?