Skip to content

Commit 7b1bf9d

Browse files
test: Increase tolerance for timing errors during testing
1 parent a1c9b30 commit 7b1bf9d

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

test/unit_test/test_vibrant/test_async.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -902,7 +902,7 @@ TEST(AsyncTest, SharedFutureVoidWaitFor) {
902902
}).share();
903903

904904
// 等待足够长的时间
905-
const bool success = sf.waitFor(milliseconds(150));
905+
const bool success = sf.waitFor(milliseconds(300));
906906
EXPECT_TRUE(success);
907907
EXPECT_TRUE(sf.ready());
908908

test/unit_test/test_vibrant/test_thread.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ TEST_F(ThreadTest, SleepForDuration) {
311311

312312
auto elapsed = std::chrono::duration_cast<std::chrono::milliseconds>(end - start);
313313
ASSERT_GE(elapsed.count(), 450); // Should sleep at least 450ms
314-
ASSERT_LE(elapsed.count(), 550); // With some tolerance for scheduling
314+
ASSERT_LE(elapsed.count(), 650); // With some tolerance for scheduling
315315

316316
// Test with different time units
317317
start = std::chrono::steady_clock::now();

0 commit comments

Comments
 (0)