mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-22 12:56:53 +00:00
Disable random ram directories to prevent OOM during tests.
We need to find a way to enable this without adding crazy heaps etc. Maybe only selected tests can run this.
This commit is contained in:
parent
81bd1f9fd2
commit
80b7377b29
@ -41,7 +41,6 @@ import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.transport.TransportAddress;
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
import org.elasticsearch.index.store.mock.MockFSIndexStoreModule;
|
||||
import org.elasticsearch.index.store.mock.MockRamIndexStoreModule;
|
||||
import org.elasticsearch.node.Node;
|
||||
import org.elasticsearch.node.internal.InternalNode;
|
||||
import org.elasticsearch.transport.TransportService;
|
||||
@ -113,7 +112,8 @@ public class TestCluster {
|
||||
}
|
||||
this.defaultSettings = ImmutableSettings.settingsBuilder()
|
||||
/* use RAM directories in 10% of the runs */
|
||||
.put("index.store.type", random.nextInt(10) == 0 ? MockRamIndexStoreModule.class.getName() : MockFSIndexStoreModule.class.getName())
|
||||
// .put("index.store.type", random.nextInt(10) == 0 ? MockRamIndexStoreModule.class.getName() : MockFSIndexStoreModule.class.getName())
|
||||
.put("index.store.type", MockFSIndexStoreModule.class.getName()) // no RAM dir for now!
|
||||
.put(defaultSettings)
|
||||
.put("cluster.name", clusterName).build();
|
||||
}
|
||||
@ -363,6 +363,7 @@ public class TestCluster {
|
||||
}
|
||||
nextNodeId.set(sharedNodesSeeds.length);
|
||||
assert numNodes() == sharedNodesSeeds.length;
|
||||
client().admin().cluster().prepareHealth().setWaitForNodes(Integer.toString(sharedNodesSeeds.length)).get();
|
||||
}
|
||||
|
||||
private void resetClients() {
|
||||
|
@ -59,8 +59,8 @@ public class SearchPreferenceTests extends AbstractSharedClusterTest {
|
||||
@Test
|
||||
public void noPreferenceRandom() throws Exception {
|
||||
client().admin().indices().prepareCreate("test").setSettings(settingsBuilder().put("index.number_of_shards", 1).put("index.number_of_replicas", 1)).execute().actionGet();
|
||||
client().admin().cluster().prepareHealth().setWaitForEvents(Priority.LANGUID).setWaitForGreenStatus().execute().actionGet();
|
||||
|
||||
ensureGreen();
|
||||
|
||||
client().prepareIndex("test", "type1").setSource("field1", "value1").execute().actionGet();
|
||||
client().admin().indices().prepareRefresh().execute().actionGet();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user