Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport 2.x] [Bug Fix] Fixing Flaky Codec Tests #9896

Merged
merged 1 commit into from
Sep 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ private void assertReindexingWithMultipleCodecs(String destCodec, String destCod
}

private void useCodec(String index, String codec) throws ExecutionException, InterruptedException {
assertAcked(client().admin().indices().prepareClose(index));
assertAcked(client().admin().indices().prepareClose(index).setWaitForActiveShards(1));

assertAcked(
client().admin()
Expand All @@ -144,7 +144,7 @@ private void useCodec(String index, String codec) throws ExecutionException, Int
.get()
);

assertAcked(client().admin().indices().prepareOpen(index));
assertAcked(client().admin().indices().prepareOpen(index).setWaitForActiveShards(1));
}

private void flushAndRefreshIndex(String index) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public void testZStandardToLuceneCodecsWithCompressionLevel() throws ExecutionEx
);
ensureGreen(index);

assertAcked(client().admin().indices().prepareClose(index));
assertAcked(client().admin().indices().prepareClose(index).setWaitForActiveShards(1));

Throwable executionException = expectThrows(
ExecutionException.class,
Expand Down Expand Up @@ -128,7 +128,7 @@ public void testZStandardToLuceneCodecsWithCompressionLevel() throws ExecutionEx
.get()
);

assertAcked(client().admin().indices().prepareOpen(index));
assertAcked(client().admin().indices().prepareOpen(index).setWaitForActiveShards(1));
ensureGreen(index);
}

Expand All @@ -148,7 +148,7 @@ public void testLuceneToZStandardCodecsWithCompressionLevel() throws ExecutionEx
);
ensureGreen(index);

assertAcked(client().admin().indices().prepareClose(index));
assertAcked(client().admin().indices().prepareClose(index).setWaitForActiveShards(1));

Throwable executionException = expectThrows(
ExecutionException.class,
Expand Down Expand Up @@ -181,7 +181,7 @@ public void testLuceneToZStandardCodecsWithCompressionLevel() throws ExecutionEx
.get()
);

assertAcked(client().admin().indices().prepareOpen(index));
assertAcked(client().admin().indices().prepareOpen(index).setWaitForActiveShards(1));
ensureGreen(index);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ protected Collection<Class<? extends Plugin>> nodePlugins() {
return Collections.singletonList(CustomCodecPlugin.class);
}

@AwaitsFix(bugUrl = "https://github.com/opensearch-project/OpenSearch/issues/9872")
public void testForceMergeMultipleCodecs() throws ExecutionException, InterruptedException {

Map<String, String> codecMap = Map.of(
Expand Down Expand Up @@ -119,7 +118,7 @@ private void forceMergeMultipleCodecs(String finalCodec, String finalCodecMode,
}

private void useCodec(String index, String codec) throws ExecutionException, InterruptedException {
assertAcked(client().admin().indices().prepareClose(index));
assertAcked(client().admin().indices().prepareClose(index).setWaitForActiveShards(1));

assertAcked(
client().admin()
Expand All @@ -128,7 +127,7 @@ private void useCodec(String index, String codec) throws ExecutionException, Int
.get()
);

assertAcked(client().admin().indices().prepareOpen(index));
assertAcked(client().admin().indices().prepareOpen(index).setWaitForActiveShards(1));
}

private void ingestDocs(String index) throws InterruptedException {
Expand Down
Loading