From d9edc33c4ac425845f05bbab0637c6e010683a1c Mon Sep 17 00:00:00 2001 From: Lourens Veen Date: Sun, 1 Oct 2023 13:03:07 +0200 Subject: [PATCH] Widen timeout in test so we have fewer CI failures --- .../cpp/src/libmuscle/tests/test_profiler.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/libmuscle/cpp/src/libmuscle/tests/test_profiler.cpp b/libmuscle/cpp/src/libmuscle/tests/test_profiler.cpp index 64c56cbe..1824c653 100644 --- a/libmuscle/cpp/src/libmuscle/tests/test_profiler.cpp +++ b/libmuscle/cpp/src/libmuscle/tests/test_profiler.cpp @@ -29,6 +29,7 @@ std::chrono::steady_clock::duration communication_interval_() { #include #include +#include #include #include #include @@ -211,7 +212,17 @@ TEST(libmuscle_profiler, test_send_to_mock_mmp_client) { TEST(libmuscle_profiler, test_send_timeout) { reset_mocks(); - communication_interval = 40ms; + + std::chrono::steady_clock::duration wait_time; + + if (getenv("CI")) { + communication_interval = 40ms; + wait_time = 500ms; + } + else { + communication_interval = 40ms; + wait_time = 60ms; + } MockMMPClient mock_mmp_client(Reference("test_instance"), ""); Profiler profiler(mock_mmp_client); @@ -220,7 +231,7 @@ TEST(libmuscle_profiler, test_send_timeout) { ProfileEventType::receive, ProfileTimestamp(), ProfileTimestamp()); profiler.record_event(ProfileEvent(e1)); - std::this_thread::sleep_for(50ms); + std::this_thread::sleep_for(wait_time); ASSERT_EQ(mock_mmp_client.last_submitted_profile_events.size(), 1u); ASSERT_EQ(mock_mmp_client.last_submitted_profile_events.at(0), e1);