Skip to content

Commit

Permalink
longer max-durations in futures retrying tests
Browse files Browse the repository at this point in the history
Summary: These tests sometimes fail Github Actions CI as well as some internal stress-runs. On loaded systems, timing-based tests may need extra slack. Allow extra slack.

Reviewed By: dmm-fb

Differential Revision: D57054080

fbshipit-source-id: 4a6ba147aea11a272fa603a406f9030f86b1b1e0
  • Loading branch information
yfeldblum authored and facebook-github-bot committed May 8, 2024
1 parent edda640 commit 990a29b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions folly/futures/test/RetryingTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,13 +225,13 @@ TEST(RetryingTest, semifuturePolicyBasic) {
}

TEST(RetryingTest, policyCappedJitteredExponentialBackoff) {
multiAttemptExpectDurationWithin(5, milliseconds(200), milliseconds(400), [] {
multiAttemptExpectDurationWithin(5, milliseconds(200), milliseconds(600), [] {
using ms = milliseconds;
auto r = futures::retrying(
futures::retryingPolicyCappedJitteredExponentialBackoff(
3,
ms(100),
ms(1000),
ms(1500),
0.1,
mt19937_64(0),
[](size_t, const exception_wrapper&) { return true; }),
Expand All @@ -245,13 +245,13 @@ TEST(RetryingTest, policyCappedJitteredExponentialBackoff) {
}

TEST(RetryingTest, policyCappedJitteredExponentialBackoffUnsafe) {
multiAttemptExpectDurationWithin(5, milliseconds(200), milliseconds(400), [] {
multiAttemptExpectDurationWithin(5, milliseconds(200), milliseconds(600), [] {
using ms = milliseconds;
auto r = futures::retryingUnsafe(
futures::retryingPolicyCappedJitteredExponentialBackoff(
3,
ms(100),
ms(1000),
ms(1500),
0.1,
mt19937_64(0),
[](size_t, const exception_wrapper&) { return true; }),
Expand Down Expand Up @@ -310,12 +310,12 @@ TEST(RetryingTest, policyCappedJitteredExponentialBackoffMinZero) {
}

TEST(RetryingTest, policySleepDefaults) {
multiAttemptExpectDurationWithin(5, milliseconds(200), milliseconds(400), [] {
multiAttemptExpectDurationWithin(5, milliseconds(200), milliseconds(600), [] {
// To ensure that this compiles with default params.
using ms = milliseconds;
auto r = futures::retrying(
futures::retryingPolicyCappedJitteredExponentialBackoff(
3, ms(100), ms(1000), 0.1),
3, ms(100), ms(1500), 0.1),
[](size_t n) {
return n < 2 ? makeFuture<size_t>(runtime_error("ha"))
: makeFuture(n);
Expand Down

0 comments on commit 990a29b

Please sign in to comment.