提交 626222c6 编写于 作者: M Megvii Engine Team

fix(test): fix test for brainpp docker env

GitOrigin-RevId: c4c2cc73d2b9c97f0e86f1a4333ec35b2a89d1f9
上级 fac67e7c
...@@ -563,10 +563,11 @@ TEST(TestCompNodeSyncManager, DeviceWait) { ...@@ -563,10 +563,11 @@ TEST(TestCompNodeSyncManager, DeviceWait) {
cn2.device_wait_event(mgr.busy_wait_set_ready_and_get_event()); cn2.device_wait_event(mgr.busy_wait_set_ready_and_get_event());
ev_cn1->record(); ev_cn1->record();
ev_cn2_end->record(); ev_cn2_end->record();
EXPECT_LE(timer.get_secs(), 0.06); std::this_thread::yield();
EXPECT_LE(timer.get_secs(), 0.09);
ev_cn1->host_wait(); ev_cn1->host_wait();
EXPECT_GE(timer.get_secs(), 0.1); EXPECT_GE(timer.get_secs(), 0.12);
ev_cn2_end->host_wait(); ev_cn2_end->host_wait();
auto ev2_t = ev_cn2_begin->elapsed_time_until(*ev_cn2_end); auto ev2_t = ev_cn2_begin->elapsed_time_until(*ev_cn2_end);
EXPECT_GE(ev2_t, 0.1); EXPECT_GE(ev2_t, 0.1);
......
...@@ -87,8 +87,8 @@ TEST(TestAsyncWorker, AsyncWorkerSetException) { ...@@ -87,8 +87,8 @@ TEST(TestAsyncWorker, AsyncWorkerSetException) {
std::this_thread::sleep_for(100ms); std::this_thread::sleep_for(100ms);
}); });
timer.reset();
worker_set.start(); worker_set.start();
timer.reset();
ASSERT_THROW(worker_set.wait_all(), std::runtime_error); ASSERT_THROW(worker_set.wait_all(), std::runtime_error);
ASSERT_LT(timer.get_msecs(), 100); ASSERT_LT(timer.get_msecs(), 100);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册