From 2eeb075739903657fd445fbd22c75fdd24a0bf50 Mon Sep 17 00:00:00 2001 From: Lysann Tranvouez Date: Fri, 3 Oct 2025 22:51:20 +0200 Subject: [PATCH] make tests less flaky --- tests/test_threads.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/test_threads.cpp b/tests/test_threads.cpp index db50fed..11af631 100644 --- a/tests/test_threads.cpp +++ b/tests/test_threads.cpp @@ -55,7 +55,7 @@ TEST_CASE( "Handling other threads", "[attach][local][threads]" ) SECTION( "running threads modify a value" ) { const int saved_b = g_b; - usleep( 100 ); // let the threads update g_b a bit + usleep( 1000 ); // let the threads update g_b a bit CHECK( saved_b != g_b ); } @@ -79,13 +79,13 @@ TEST_CASE( "Handling other threads", "[attach][local][threads]" ) } int saved_b = g_b; - usleep( 300 ); // let any running thread update g_b a bit + usleep( 1000 ); // let any running thread update g_b a bit CHECK( saved_b == g_b ); CHECK( detour_transaction_commit() == err_none ); saved_b = g_b; - usleep( 100 ); // let the threads update g_b a bit + usleep( 1000 ); // let the threads update g_b a bit CHECK( saved_b != g_b ); } @@ -95,7 +95,7 @@ TEST_CASE( "Handling other threads", "[attach][local][threads]" ) CHECK( detour_transaction_abort() == err_none ); const int saved_b = g_b; - usleep( 100 ); // let the threads update g_b a bit + usleep( 1000 ); // let the threads update g_b a bit CHECK( saved_b != g_b ); } @@ -108,7 +108,7 @@ TEST_CASE( "Handling other threads", "[attach][local][threads]" ) CHECK( detour_attach_and_commit(reinterpret_cast(&realLocalFunction), reinterpret_cast(localFunctionDetour)) == err_none ); const int saved_b = g_b; - usleep( 300 ); // let the threads update g_b a bit + usleep( 1000 ); // let the threads update g_b a bit CHECK( saved_b != g_b ); // clean up