Commit c1ad77a5 authored by Tianjiao Yin's avatar Tianjiao Yin Committed by Facebook Github Bot 0

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
parent 2062a6ba
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment