diff --git a/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex.pass.cpp b/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex.pass.cpp --- a/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex.pass.cpp +++ b/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex.pass.cpp @@ -42,7 +42,7 @@ // Thread sanitizer causes more overhead and will sometimes cause this test // to fail. To prevent this we give Thread sanitizer more time to complete the // test. -#if !defined(TEST_HAS_SANITIZERS) +#if !defined(TEST_IS_EXECUTED_IN_A_SLOW_ENVIRONMENT) ms Tolerance = ms(50); #else ms Tolerance = ms(50 * 5); diff --git a/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/lock.pass.cpp b/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/lock.pass.cpp --- a/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/lock.pass.cpp +++ b/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.locking/lock.pass.cpp @@ -41,7 +41,7 @@ // Thread sanitizer causes more overhead and will sometimes cause this test // to fail. To prevent this we give Thread sanitizer more time to complete the // test. -#if !defined(TEST_HAS_SANITIZERS) +#if !defined(TEST_IS_EXECUTED_IN_A_SLOW_ENVIRONMENT) ms Tolerance = ms(25); #else ms Tolerance = ms(25 * 5); diff --git a/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/lock.pass.cpp b/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/lock.pass.cpp --- a/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/lock.pass.cpp +++ b/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/lock.pass.cpp @@ -41,7 +41,7 @@ // Thread sanitizer causes more overhead and will sometimes cause this test // to fail. To prevent this we give Thread sanitizer more time to complete the // test. -#if !defined(TEST_HAS_SANITIZERS) +#if !defined(TEST_IS_EXECUTED_IN_A_SLOW_ENVIRONMENT) ms Tolerance = ms(50); #else ms Tolerance = ms(50 * 5); diff --git a/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/lock_shared.pass.cpp b/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/lock_shared.pass.cpp --- a/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/lock_shared.pass.cpp +++ b/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/thread.shared_mutex.class/lock_shared.pass.cpp @@ -42,7 +42,7 @@ // Thread sanitizer causes more overhead and will sometimes cause this test // to fail. To prevent this we give Thread sanitizer more time to complete the // test. -#if !defined(TEST_HAS_SANITIZERS) +#if !defined(TEST_IS_EXECUTED_IN_A_SLOW_ENVIRONMENT) ms Tolerance = ms(50); #else ms Tolerance = ms(50 * 5); diff --git a/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_for.pass.cpp b/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_for.pass.cpp --- a/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_for.pass.cpp +++ b/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_for.pass.cpp @@ -42,7 +42,7 @@ // Thread sanitizer causes more overhead and will sometimes cause this test // to fail. To prevent this we give Thread sanitizer more time to complete the // test. -#if !defined(TEST_HAS_SANITIZERS) +#if !defined(TEST_IS_EXECUTED_IN_A_SLOW_ENVIRONMENT) ms Tolerance = ms(50); #else ms Tolerance = ms(50 * 5); diff --git a/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_shared.pass.cpp b/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_shared.pass.cpp --- a/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_shared.pass.cpp +++ b/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_shared.pass.cpp @@ -38,7 +38,10 @@ typedef std::chrono::nanoseconds ns; -#if !defined(TEST_HAS_SANITIZERS) +// Thread sanitizer causes more overhead and will sometimes cause this test +// to fail. To prevent this we give Thread sanitizer more time to complete the +// test. +#if !defined(TEST_IS_EXECUTED_IN_A_SLOW_ENVIRONMENT) ms Tolerance = ms(200); #else ms Tolerance = ms(200 * 5); diff --git a/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_shared_for.pass.cpp b/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_shared_for.pass.cpp --- a/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_shared_for.pass.cpp +++ b/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_shared_for.pass.cpp @@ -43,7 +43,7 @@ // Thread sanitizer causes more overhead and will sometimes cause this test // to fail. To prevent this we give Thread sanitizer more time to complete the // test. -#if !defined(TEST_HAS_SANITIZERS) +#if !defined(TEST_IS_EXECUTED_IN_A_SLOW_ENVIRONMENT) ms Tolerance = ms(50); #else ms Tolerance = ms(50 * 5); diff --git a/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_until.pass.cpp b/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_until.pass.cpp --- a/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_until.pass.cpp +++ b/libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/thread.sharedtimedmutex.class/try_lock_until.pass.cpp @@ -43,7 +43,7 @@ // Thread sanitizer causes more overhead and will sometimes cause this test // to fail. To prevent this we give Thread sanitizer more time to complete the // test. -#if !defined(TEST_HAS_SANITIZERS) +#if !defined(TEST_IS_EXECUTED_IN_A_SLOW_ENVIRONMENT) ms Tolerance = ms(50); #else ms Tolerance = ms(50 * 5); diff --git a/libcxx/test/support/test_macros.h b/libcxx/test/support/test_macros.h --- a/libcxx/test/support/test_macros.h +++ b/libcxx/test/support/test_macros.h @@ -193,6 +193,7 @@ #if TEST_HAS_FEATURE(address_sanitizer) || TEST_HAS_FEATURE(hwaddress_sanitizer) || \ TEST_HAS_FEATURE(memory_sanitizer) || TEST_HAS_FEATURE(thread_sanitizer) #define TEST_HAS_SANITIZERS +#define TEST_IS_EXECUTED_IN_A_SLOW_ENVIRONMENT #endif #if defined(_LIBCPP_NORETURN)