Skip to content

Commit d3d1bbc

Browse files
authored
Allow to disable addMockFSIndexStore test plugin (#93473)
The MockFSIndexStore randomizes the store type index settings in tests. It also throws random I/O exceptions and checks the index when shards are closed. This behavior is sometimes unwanted in tests, but today tests cannot change the default random behavior. This change allows to disable this test plugin on specific tests.
1 parent ea90f92 commit d3d1bbc

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

test/framework/src/main/java/org/elasticsearch/test/ESIntegTestCase.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2056,6 +2056,13 @@ protected boolean addMockInternalEngine() {
20562056
return true;
20572057
}
20582058

2059+
/**
2060+
* Returns {@code true} if this test cluster can use the {@link MockFSIndexStore} test plugin. Defaults to true.
2061+
*/
2062+
protected boolean addMockFSIndexStore() {
2063+
return true;
2064+
}
2065+
20592066
/**
20602067
* Returns a function that allows to wrap / filter all clients that are exposed by the test cluster. This is useful
20612068
* for debugging or request / response pre and post processing. It also allows to intercept all calls done by the test
@@ -2072,7 +2079,7 @@ protected Collection<Class<? extends Plugin>> getMockPlugins() {
20722079
if (randomBoolean() && addMockTransportService()) {
20732080
mocks.add(MockTransportService.TestPlugin.class);
20742081
}
2075-
if (randomBoolean()) {
2082+
if (addMockFSIndexStore() && randomBoolean()) {
20762083
mocks.add(MockFSIndexStore.TestPlugin.class);
20772084
}
20782085
if (randomBoolean()) {

0 commit comments

Comments
 (0)