Skip to content

Commit b4b25dc

Browse files
authored
Revert "amending tests to include all codecs (#8907)" (#8968)
This reverts commit c43743d. Signed-off-by: Andriy Redko <[email protected]>
1 parent 0003bd8 commit b4b25dc

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

qa/rolling-upgrade/src/test/java/org/opensearch/upgrades/IndexingIT.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
import org.opensearch.common.Booleans;
4141
import org.opensearch.common.io.Streams;
4242
import org.opensearch.common.settings.Settings;
43+
import org.opensearch.index.codec.CodecService;
4344
import org.opensearch.index.engine.EngineConfig;
4445
import org.opensearch.indices.replication.common.ReplicationType;
4546
import org.opensearch.test.rest.yaml.ObjectPath;
@@ -53,7 +54,6 @@
5354

5455
import static org.opensearch.cluster.routing.UnassignedInfo.INDEX_DELAYED_NODE_LEFT_TIMEOUT_SETTING;
5556
import static org.opensearch.rest.action.search.RestSearchAction.TOTAL_HITS_AS_INT_PARAM;
56-
import static org.opensearch.test.OpenSearchIntegTestCase.CODECS;
5757

5858
/**
5959
* Basic test that indexed documents survive the rolling restart. See
@@ -267,7 +267,7 @@ public void testIndexingWithSegRep() throws Exception {
267267
.put(IndexMetadata.SETTING_REPLICATION_TYPE, ReplicationType.SEGMENT)
268268
.put(
269269
EngineConfig.INDEX_CODEC_SETTING.getKey(),
270-
randomFrom(CODECS)
270+
randomFrom(CodecService.DEFAULT_CODEC, CodecService.BEST_COMPRESSION_CODEC, CodecService.LUCENE_DEFAULT_CODEC)
271271
)
272272
.put(INDEX_DELAYED_NODE_LEFT_TIMEOUT_SETTING.getKey(), "100ms");
273273
createIndex(indexName, settings.build());

server/src/internalClusterTest/java/org/opensearch/indices/replication/SegmentReplicationIT.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
import org.opensearch.index.SegmentReplicationPerGroupStats;
5454
import org.opensearch.index.SegmentReplicationPressureService;
5555
import org.opensearch.index.SegmentReplicationShardStats;
56+
import org.opensearch.index.codec.CodecService;
5657
import org.opensearch.index.engine.Engine;
5758
import org.opensearch.index.engine.EngineConfig;
5859
import org.opensearch.index.engine.NRTReplicationReaderManager;
@@ -200,7 +201,10 @@ public void testReplicationAfterPrimaryRefreshAndFlush() throws Exception {
200201
final String nodeB = internalCluster().startDataOnlyNode();
201202
final Settings settings = Settings.builder()
202203
.put(indexSettings())
203-
.put(EngineConfig.INDEX_CODEC_SETTING.getKey(), randomFrom(CODECS))
204+
.put(
205+
EngineConfig.INDEX_CODEC_SETTING.getKey(),
206+
randomFrom(CodecService.DEFAULT_CODEC, CodecService.BEST_COMPRESSION_CODEC, CodecService.LUCENE_DEFAULT_CODEC)
207+
)
204208
.build();
205209
createIndex(INDEX_NAME, settings);
206210
ensureGreen(INDEX_NAME);

test/framework/src/main/java/org/opensearch/test/OpenSearchIntegTestCase.java

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -364,14 +364,6 @@ public abstract class OpenSearchIntegTestCase extends OpenSearchTestCase {
364364
private static OpenSearchIntegTestCase INSTANCE = null; // see @SuiteScope
365365
private static Long SUITE_SEED = null;
366366

367-
public static List<String> CODECS = List.of(
368-
CodecService.DEFAULT_CODEC,
369-
CodecService.BEST_COMPRESSION_CODEC,
370-
CodecService.LUCENE_DEFAULT_CODEC,
371-
CodecService.ZSTD_CODEC,
372-
CodecService.ZSTD_NO_DICT_CODEC
373-
);
374-
375367
@BeforeClass
376368
public static void beforeClass() throws Exception {
377369
SUITE_SEED = randomLong();
@@ -435,7 +427,7 @@ protected void randomIndexTemplate() {
435427
// otherwise, use it, it has assertions and so on that can find bugs.
436428
SuppressCodecs annotation = getClass().getAnnotation(SuppressCodecs.class);
437429
if (annotation != null && annotation.value().length == 1 && "*".equals(annotation.value()[0])) {
438-
randomSettingsBuilder.put("index.codec", randomFrom(CODECS));
430+
randomSettingsBuilder.put("index.codec", randomFrom(CodecService.DEFAULT_CODEC, CodecService.BEST_COMPRESSION_CODEC));
439431
} else {
440432
randomSettingsBuilder.put("index.codec", CodecService.LUCENE_DEFAULT_CODEC);
441433
}

0 commit comments

Comments
 (0)