Skip to content

Commit 64fc423

Browse files
committed
Increase times to pass tests
MSVC also has problems with the quick switching between threads so this is yet another try to stabalize the tests. Signed-off-by: Ted Lyngmo <ted@lyncon.se>
1 parent 426bd60 commit 64fc423

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/beman/timed_lock_alg/mutex.test.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,15 @@ TEST(Mutex, return_last_failed) {
7777
std::array<std::timed_mutex, 2> mtxs;
7878
auto th = JThread([&] {
7979
std::lock(mtxs[0], mtxs[1]);
80-
std::this_thread::sleep_for(10ms);
81-
mtxs[0].unlock(); // 5ms after try_lock_for started, 5ms left
80+
std::this_thread::sleep_for(50ms);
81+
mtxs[0].unlock(); // 25ms after try_lock_for
8282

8383
// try_lock_for here hangs on mtxs[1] and should return 1:
84-
std::this_thread::sleep_for(30ms + extra_grace);
84+
std::this_thread::sleep_for(50ms + extra_grace);
8585
mtxs[1].unlock();
8686
});
8787

88-
std::this_thread::sleep_for(5ms);
88+
std::this_thread::sleep_for(25ms);
8989
EXPECT_EQ(1, std::apply([](auto&... mts) { return tla::try_lock_for(10ms, mts...); }, mtxs));
9090
}
9191

0 commit comments

Comments
 (0)