fix TestTaskLeaseRenewal test failure (#7765)

This commit is contained in:
fangfengbin
2020-03-29 11:18:47 +08:00
committed by GitHub
parent d87563937e
commit 6ce8b63bb6
@@ -449,7 +449,12 @@ TEST_F(TaskDependencyManagerTest, TestTaskLeaseRenewal) {
for (int i = 1; i <= num_expected_calls; i++) {
sleep_time += i * initial_lease_period_ms_;
}
EXPECT_CALL(*task_accessor_mock_, AsyncAddTaskLease(_, _)).Times(num_expected_calls);
// When sleep_time = 10 * initial_lease_period_ms_, test case fails, because the
// AsyncAddTaskLease function is expected to be called four times, but only three times.
// It's hard to determine the sleep_time value, so let's double it for now.
sleep_time = sleep_time * 2;
EXPECT_CALL(*task_accessor_mock_, AsyncAddTaskLease(_, _))
.Times(testing::AtLeast(num_expected_calls));
Run(sleep_time);
}