From c1ad77a56bd725605154c4e71a852a3232b95481 Mon Sep 17 00:00:00 2001 From: Tianjiao Yin Date: Thu, 22 Sep 2016 01:06:15 -0700 Subject: [PATCH] fix flaky TimeKeeper unit-test Summary: Sometime we have such unit-test failure ``` folly/futures/test/TimekeeperTest.cpp:134: Failure Value of: flag Actual: false Expected: true ``` This diff should make it less flaky, though I am not sure what's the best way to fix this flaky unit-test. Reviewed By: yfeldblum Differential Revision: D3889630 fbshipit-source-id: e7486d75fbcb3081d06724d213d4a2cf8942955d --- folly/futures/test/TimekeeperTest.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/folly/futures/test/TimekeeperTest.cpp b/folly/futures/test/TimekeeperTest.cpp index 676d6351..664dd737 100644 --- a/folly/futures/test/TimekeeperTest.cpp +++ b/folly/futures/test/TimekeeperTest.cpp @@ -128,7 +128,7 @@ TEST(Timekeeper, futureWithinException) { TEST(Timekeeper, onTimeout) { bool flag = false; - makeFuture(42).delayed(one_ms) + makeFuture(42).delayed(10 * one_ms) .onTimeout(zero_ms, [&]{ flag = true; return -1; }) .get(); EXPECT_TRUE(flag); @@ -136,7 +136,7 @@ TEST(Timekeeper, onTimeout) { TEST(Timekeeper, onTimeoutReturnsFuture) { bool flag = false; - makeFuture(42).delayed(one_ms) + makeFuture(42).delayed(10 * one_ms) .onTimeout(zero_ms, [&]{ flag = true; return makeFuture(-1); }) .get(); EXPECT_TRUE(flag); -- 2.34.1