|
42 | 42 | import org.elasticsearch.cluster.routing.RecoverySource.SnapshotRecoverySource; |
43 | 43 | import org.elasticsearch.cluster.routing.allocation.command.MoveAllocationCommand; |
44 | 44 | import org.elasticsearch.cluster.service.ClusterService; |
| 45 | +import org.elasticsearch.common.settings.Setting; |
45 | 46 | import org.elasticsearch.common.settings.Settings; |
46 | 47 | import org.elasticsearch.common.unit.ByteSizeUnit; |
47 | 48 | import org.elasticsearch.common.unit.ByteSizeValue; |
|
82 | 83 | import java.util.ArrayList; |
83 | 84 | import java.util.Arrays; |
84 | 85 | import java.util.Collection; |
| 86 | +import java.util.Collections; |
85 | 87 | import java.util.List; |
86 | 88 | import java.util.Map; |
87 | 89 | import java.util.concurrent.CountDownLatch; |
|
90 | 92 | import java.util.concurrent.atomic.AtomicBoolean; |
91 | 93 | import java.util.concurrent.atomic.AtomicInteger; |
92 | 94 | import java.util.function.Consumer; |
| 95 | +import java.util.function.Function; |
93 | 96 |
|
94 | 97 | import static java.util.Collections.singletonMap; |
95 | 98 | import static org.elasticsearch.node.RecoverySettingsChunkSizePlugin.CHUNK_SIZE_SETTING; |
@@ -119,7 +122,7 @@ public class IndexRecoveryIT extends ESIntegTestCase { |
119 | 122 | @Override |
120 | 123 | protected Collection<Class<? extends Plugin>> nodePlugins() { |
121 | 124 | return Arrays.asList(MockTransportService.TestPlugin.class, MockFSIndexStore.TestPlugin.class, |
122 | | - RecoverySettingsChunkSizePlugin.class, TestAnalysisPlugin.class); |
| 125 | + RecoverySettingsChunkSizePlugin.class, TestAnalysisPlugin.class, AssertionPlugin.class); |
123 | 126 | } |
124 | 127 |
|
125 | 128 | @After |
@@ -875,7 +878,7 @@ public void testHistoryRetention() throws Exception { |
875 | 878 | } |
876 | 879 |
|
877 | 880 | public void testDoNotInfinitelyWaitForMapping() { |
878 | | - internalCluster().ensureAtLeastNumDataNodes(3); |
| 881 | + internalCluster().startNodes(3, Settings.builder().put("assertion.disabled", RecoveryTarget.class.getName()).build()); |
879 | 882 | createIndex("test", Settings.builder() |
880 | 883 | .put("index.analysis.analyzer.test_analyzer.type", "custom") |
881 | 884 | .put("index.analysis.analyzer.test_analyzer.tokenizer", "standard") |
@@ -926,4 +929,13 @@ public TokenStream create(TokenStream tokenStream) { |
926 | 929 | }); |
927 | 930 | } |
928 | 931 | } |
| 932 | + |
| 933 | + public static final class AssertionPlugin extends Plugin { |
| 934 | + @Override |
| 935 | + public List<Setting<?>> getSettings() { |
| 936 | + return Collections.singletonList( |
| 937 | + Setting.listSetting("assertion.disabled", Collections.emptyList(), Function.identity(), Setting.Property.NodeScope) |
| 938 | + ); |
| 939 | + } |
| 940 | + } |
929 | 941 | } |
0 commit comments