From 87d64678a0daa74c94c076a1e6cba1aa35ff04f8 Mon Sep 17 00:00:00 2001 From: Dnomd343 Date: Mon, 30 Jan 2023 21:52:36 +0800 Subject: [PATCH] fix: delay status check after thread create --- test/codec/short_code.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/test/codec/short_code.cc b/test/codec/short_code.cc index 59d7f2b..0d7def2 100644 --- a/test/codec/short_code.cc +++ b/test/codec/short_code.cc @@ -50,6 +50,7 @@ TEST(ShortCode, speed_up) { for (auto &t : threads) { t = std::thread(ShortCode::speed_up, ShortCode::FAST); } + usleep(1000); // wait 1ms -> avoid mutex unlocked EXPECT_EQ(AllCases::status(), AllCases::BUILDING); for (auto &t : threads) { t.join();