[TEST] Use NoMergePolicy in EngineTest#testVerboseSegments
These tests rely on that there are no merges but since MP is now random this can break the test.
This commit is contained in:
parent
0ac09fde95
commit
02e540384d
|
@ -384,6 +384,9 @@ public class InternalEngineTests extends ElasticsearchTestCase {
|
|||
}
|
||||
|
||||
public void testVerboseSegments() throws Exception {
|
||||
IndexSettingsService indexSettingsService = new IndexSettingsService(shardId.index(), Settings.builder().put(defaultSettings).put(IndexMetaData.SETTING_VERSION_CREATED, Version.CURRENT).build());
|
||||
try (Store store = createStore();
|
||||
Engine engine = createEngine(indexSettingsService, store, createTempDir(), new MergeSchedulerConfig(defaultSettings), NoMergePolicy.INSTANCE)) {
|
||||
List<Segment> segments = engine.segments(true);
|
||||
assertThat(segments.isEmpty(), equalTo(true));
|
||||
|
||||
|
@ -407,6 +410,7 @@ public class InternalEngineTests extends ElasticsearchTestCase {
|
|||
assertThat(segments.get(0).ramTree, notNullValue());
|
||||
assertThat(segments.get(1).ramTree, notNullValue());
|
||||
assertThat(segments.get(2).ramTree, notNullValue());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -440,6 +440,9 @@ public class ShadowEngineTests extends ElasticsearchTestCase {
|
|||
|
||||
@Test
|
||||
public void testVerboseSegments() throws Exception {
|
||||
IndexSettingsService indexSettingsService = new IndexSettingsService(shardId.index(), Settings.builder().put(defaultSettings).put(IndexMetaData.SETTING_VERSION_CREATED, Version.CURRENT).build());
|
||||
primaryEngine.close(); // recreate without merging
|
||||
primaryEngine = createInternalEngine(indexSettingsService, store, createTempDir(), NoMergePolicy.INSTANCE);
|
||||
List<Segment> segments = primaryEngine.segments(true);
|
||||
assertThat(segments.isEmpty(), equalTo(true));
|
||||
|
||||
|
|
Loading…
Reference in New Issue