Skip to content

Commit

Permalink
fix flaky SlidingBloomReplayCacheTest.cpp
Browse files Browse the repository at this point in the history
SlidingBloomReplayCacheTest.cpp test was flaky,  looks like the expiry
can happen at exactly 1 second, moving to 1001 milliseconds fixed it.

Test Plan:

Run locally

```
 ./build/fbcode_builder/getdeps.py build --src-dir=. fizz
 ./build/fbcode_builder/getdeps.py test --src-dir=. fizz
```

before, fails with:
```
[==========] 5 tests from 1 test suite ran. (1115 ms total)
[  PASSED  ] 4 tests.
[  FAILED  ] 1 test, listed below:
[  FAILED  ] SlidingBloomReplayCacheTest.TestTimeBucketing

 1 FAILED TEST
```

after, passes with:
```
100% tests passed, 0 tests failed out of 68

Total Test time (real) =   1.07 sec

```
  • Loading branch information
ahornby committed Jul 22, 2023
1 parent 45567ee commit f93d092
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fizz/server/test/SlidingBloomReplayCacheTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ TEST(SlidingBloomReplayCacheTest, TestTimeBucketing) {
}
baton.post();
},
std::chrono::seconds(1));
std::chrono::milliseconds(1001));
});
baton.wait();
}
Expand Down

0 comments on commit f93d092

Please sign in to comment.