[fixit] Loosen bounds on periodic update test (#30612)

pull/30614/head
Craig Tiller 2 years ago committed by GitHub
parent b85776b539
commit 83825a889f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      test/core/resource_quota/periodic_update_test.cc

@ -60,12 +60,12 @@ TEST(PeriodicUpdateTest, SimpleTest) {
ExecCtx exec_ctx;
upd->Tick([&](Duration) { done = true; });
}
// Ensure the time taken was between 1 and 1.5 seconds - we make a little
// Ensure the time taken was between 1 and 3 seconds - we make a little
// allowance for the presumed inaccuracy of this type.
{
ExecCtx exec_ctx;
EXPECT_GE(exec_ctx.Now() - start, Duration::Seconds(1));
EXPECT_LE(exec_ctx.Now() - start, Duration::Milliseconds(1500));
EXPECT_LE(exec_ctx.Now() - start, Duration::Seconds(3));
start = exec_ctx.Now();
}
}
@ -101,11 +101,11 @@ TEST(PeriodicUpdate, ThreadTest) {
for (auto& th : threads) {
th.join();
}
// Ensure our ten cycles took at least 10 seconds, and no more than 15.
// Ensure our ten cycles took at least 10 seconds, and no more than 30.
{
ExecCtx exec_ctx;
EXPECT_GE(exec_ctx.Now() - start, Duration::Seconds(10));
EXPECT_LE(exec_ctx.Now() - start, Duration::Seconds(15));
EXPECT_LE(exec_ctx.Now() - start, Duration::Seconds(30));
}
}

Loading…
Cancel
Save