[bug fix] fix core at TenantConfigUpdateTask::runTimerTask

This commit is contained in:
obdev
2023-12-22 17:43:00 +00:00
committed by ob-robot
parent 9a2877c1c7
commit 0fb14b67fa
6 changed files with 221 additions and 27 deletions

View File

@ -144,7 +144,8 @@ TEST(TestTimer, task_cancel_wait)
task.exec_time_ = 1000000;
int64_t cur_time = ObTimeUtility::current_time();
ASSERT_EQ(OB_SUCCESS, timer.schedule(task, 0, true));
usleep(10000);
// it must sleep for enough time to ensure that the task has started running
usleep(50000);
ASSERT_EQ(OB_SUCCESS, timer.cancel_task(task));
// repeat cancel
ASSERT_EQ(OB_SUCCESS, timer.cancel_task(task));