Skip to content

Commit

Permalink
Fix flaky behavior of RemoteStoreRestoreIT.testRateLimitedRemoteDownl…
Browse files Browse the repository at this point in the history
…oads (opensearch-project#9887)

* Fix flaky behavior of RemoteStoreRestoreIT.testRateLimitedRemoteDownloads

Signed-off-by: Sachin Kale <[email protected]>
  • Loading branch information
sachinpkale authored Sep 15, 2023
1 parent 7d1fa7d commit 74fcaab
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ public static Settings buildRemoteStoreNodeAttributes(

if (withRateLimiterAttributes) {
settings.put(segmentRepoSettingsAttributeKeyPrefix + "compress", randomBoolean())
.put(segmentRepoSettingsAttributeKeyPrefix + "max_remote_download_bytes_per_sec", "2kb")
.put(segmentRepoSettingsAttributeKeyPrefix + "max_remote_download_bytes_per_sec", "4kb")
.put(segmentRepoSettingsAttributeKeyPrefix + "chunk_size", 200, ByteSizeUnit.BYTES);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -406,9 +406,10 @@ public void testRateLimitedRemoteDownloads() throws Exception {
for (RepositoriesService repositoriesService : internalCluster().getDataNodeInstances(RepositoriesService.class)) {
downloadPauseTime += repositoriesService.repository(REPOSITORY_NAME).getRemoteDownloadThrottleTimeInNanos();
}
assertThat(downloadPauseTime, greaterThan(TimeValue.timeValueSeconds(randomIntBetween(5, 10)).nanos()));
assertThat(downloadPauseTime, greaterThan(TimeValue.timeValueSeconds(randomIntBetween(3, 5)).nanos()));
}, 30, TimeUnit.SECONDS);
ensureGreen(INDEX_NAME);
// Waiting for extended period for green state so that rate limit does not cause flakiness
ensureGreen(TimeValue.timeValueSeconds(120), INDEX_NAME);
// This is required to get updated number from already active shards which were not restored
assertEquals(shardCount, getNumShards(INDEX_NAME).totalNumShards);
assertEquals(0, getNumShards(INDEX_NAME).numReplicas);
Expand Down

0 comments on commit 74fcaab

Please sign in to comment.