run many-seeds tests at least a few times on all tier 1 targets
This commit is contained in:
parent
ea9cff254f
commit
247e82cb83
@ -128,16 +128,18 @@ function run_tests_minimal {
|
||||
## Main Testing Logic ##
|
||||
|
||||
# In particular, fully cover all tier 1 targets.
|
||||
# We also want to run the many-seeds tests on all tier 1 targets.
|
||||
case $HOST_TARGET in
|
||||
x86_64-unknown-linux-gnu)
|
||||
# Host
|
||||
GC_STRESS=1 MIR_OPT=1 MANY_SEEDS=64 TEST_BENCH=1 CARGO_MIRI_ENV=1 run_tests
|
||||
# Extra tier 1
|
||||
MIRI_TEST_TARGET=i686-unknown-linux-gnu run_tests
|
||||
MIRI_TEST_TARGET=aarch64-unknown-linux-gnu run_tests
|
||||
MIRI_TEST_TARGET=x86_64-apple-darwin run_tests
|
||||
MIRI_TEST_TARGET=i686-pc-windows-gnu run_tests
|
||||
MIRI_TEST_TARGET=x86_64-pc-windows-gnu run_tests
|
||||
# With reduced many-seed count to avoid spending too much time on that.
|
||||
# (All OSes are run with 64 seeds at least once though via the macOS runner.)
|
||||
MANY_SEEDS=16 MIRI_TEST_TARGET=i686-unknown-linux-gnu run_tests
|
||||
MANY_SEEDS=16 MIRI_TEST_TARGET=aarch64-unknown-linux-gnu run_tests
|
||||
MANY_SEEDS=16 MIRI_TEST_TARGET=x86_64-apple-darwin run_tests
|
||||
MANY_SEEDS=16 MIRI_TEST_TARGET=x86_64-pc-windows-gnu run_tests
|
||||
# Extra tier 2
|
||||
MIRI_TEST_TARGET=aarch64-apple-darwin run_tests
|
||||
MIRI_TEST_TARGET=arm-unknown-linux-gnueabi run_tests
|
||||
@ -155,13 +157,15 @@ case $HOST_TARGET in
|
||||
# Host (tier 2)
|
||||
GC_STRESS=1 MIR_OPT=1 MANY_SEEDS=64 TEST_BENCH=1 CARGO_MIRI_ENV=1 run_tests
|
||||
# Extra tier 1
|
||||
MIRI_TEST_TARGET=x86_64-pc-windows-msvc CARGO_MIRI_ENV=1 run_tests
|
||||
MANY_SEEDS=64 MIRI_TEST_TARGET=i686-pc-windows-gnu run_tests
|
||||
MANY_SEEDS=64 MIRI_TEST_TARGET=x86_64-pc-windows-msvc CARGO_MIRI_ENV=1 run_tests
|
||||
# Extra tier 2
|
||||
MIRI_TEST_TARGET=s390x-unknown-linux-gnu run_tests # big-endian architecture
|
||||
;;
|
||||
i686-pc-windows-msvc)
|
||||
# Host
|
||||
# Only smoke-test `many-seeds`; 64 runs take 15min here!
|
||||
# Only smoke-test `many-seeds`; 64 runs of just the scoped-thread-leak test take 15min here!
|
||||
# See <https://github.com/rust-lang/miri/issues/3509>.
|
||||
GC_STRESS=1 MIR_OPT=1 MANY_SEEDS=1 TEST_BENCH=1 run_tests
|
||||
# Extra tier 1
|
||||
# We really want to ensure a Linux target works on a Windows host,
|
||||
|
@ -1,13 +1,26 @@
|
||||
//! Regression test for <https://github.com/rust-lang/rust/issues/123583>.
|
||||
use std::thread;
|
||||
|
||||
pub(crate) fn with_thread_local() {
|
||||
fn with_thread_local1() {
|
||||
thread_local! { static X: Box<u8> = Box::new(0); }
|
||||
X.with(|_x| {})
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let j2 = thread::spawn(with_thread_local);
|
||||
with_thread_local();
|
||||
j2.join().unwrap();
|
||||
fn with_thread_local2() {
|
||||
thread_local! { static Y: Box<u8> = Box::new(0); }
|
||||
Y.with(|_y| {})
|
||||
}
|
||||
|
||||
fn main() {
|
||||
// Here we have two threads racing on initializing the thread-local and adding it to the global
|
||||
// dtor list (on targets that have such a list, i.e., targets without target_thread_local).
|
||||
let t = thread::spawn(with_thread_local1);
|
||||
with_thread_local1();
|
||||
t.join().unwrap();
|
||||
|
||||
// Here we have one thread running the destructors racing with another thread initializing a
|
||||
// thread-local. The second thread adds a destructor that could be picked up by the first.
|
||||
let t = thread::spawn(|| { /* immediately just run destructors */ });
|
||||
with_thread_local2(); // initialize thread-local
|
||||
t.join().unwrap();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user