Progmasoft Git

catch3

Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.

Clonegit clone https://git.progmasoft.com/catch3

Increase timing window for min duration tests to 1s

This test tends to be brittle on Mac CI machines, which are
heavily loaded and bursty. Since the tests are only run as part
of the "extra tests" test set, this increase should not have
a significant impact on the total duration of CI runs.
Commit
3afea8128a060888db8d5547fd35400c7ecb05e4
Author
Martin Hořeňovský ·
Parents
749d95371221

Files · Download .tar.gz

Changes

 tests/ExtraTests/CMakeLists.txt            | 4 ++--
 tests/SelfTest/TimingTests/Sleep.tests.cpp | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/tests/ExtraTests/CMakeLists.txt b/tests/ExtraTests/CMakeLists.txt
index 62319b38..a861345d 100644
--- a/tests/ExtraTests/CMakeLists.txt
+++ b/tests/ExtraTests/CMakeLists.txt
@@ -11,11 +11,11 @@ message( STATUS "Extra tests included" )
 # The MinDuration reporting tests do not need separate compilation, but
 # they have non-trivial execution time, so they are categorized as
 # extra tests, so that they are run less.
-add_test(NAME MinDuration::SimpleThreshold COMMAND $<TARGET_FILE:SelfTest> --min-duration 0.245 [min_duration_test])
+add_test(NAME MinDuration::SimpleThreshold COMMAND $<TARGET_FILE:SelfTest> --min-duration 0.950 [min_duration_test])
 set_tests_properties(
     MinDuration::SimpleThreshold
   PROPERTIES
-    PASS_REGULAR_EXPRESSION "s: sleep_for_250ms"
+    PASS_REGULAR_EXPRESSION "s: sleep_for_1000ms"
     FAIL_REGULAR_EXPRESSION "sleep_for_100ms"
     RUN_SERIAL ON  # The test is timing sensitive, so we want to run it
     # serially to avoid false positives on oversubscribed machines
diff --git a/tests/SelfTest/TimingTests/Sleep.tests.cpp b/tests/SelfTest/TimingTests/Sleep.tests.cpp
index d8b958be..1c82e0e9 100644
--- a/tests/SelfTest/TimingTests/Sleep.tests.cpp
+++ b/tests/SelfTest/TimingTests/Sleep.tests.cpp
@@ -16,8 +16,8 @@ TEST_CASE( "sleep_for_100ms", "[.min_duration_test][approvals]" )
   CHECK( true );
 }
 
-TEST_CASE( "sleep_for_250ms", "[.min_duration_test][approvals]" )
+TEST_CASE( "sleep_for_1000ms", "[.min_duration_test][approvals]" )
 {
-  std::this_thread::sleep_for( std::chrono::milliseconds( 250 ) );
+  std::this_thread::sleep_for( std::chrono::milliseconds( 1'000 ) );
   CHECK( true );
 }