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) (opensearch-project#10068)

* Fix flaky behavior of RemoteStoreRestoreIT.testRateLimitedRemoteDownloads


(cherry picked from commit 74fcaab)

Signed-off-by: Sachin Kale <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
1 parent 43f6717 commit 9d3ee61
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 9d3ee61

Please sign in to comment.