increase (use default) timeout to green in test
This commit is contained in:
parent
616b09e9b4
commit
67787421b2
|
@ -20,20 +20,20 @@
|
||||||
package org.elasticsearch.test.integration.indices.store;
|
package org.elasticsearch.test.integration.indices.store;
|
||||||
|
|
||||||
import org.apache.lucene.store.Directory;
|
import org.apache.lucene.store.Directory;
|
||||||
import org.elasticsearch.common.unit.TimeValue;
|
|
||||||
import org.elasticsearch.env.Environment;
|
import org.elasticsearch.env.Environment;
|
||||||
import org.elasticsearch.index.shard.service.InternalIndexShard;
|
import org.elasticsearch.index.shard.service.InternalIndexShard;
|
||||||
import org.elasticsearch.indices.IndexMissingException;
|
import org.elasticsearch.indices.IndexMissingException;
|
||||||
import org.elasticsearch.indices.IndicesService;
|
import org.elasticsearch.indices.IndicesService;
|
||||||
import org.elasticsearch.node.internal.InternalNode;
|
import org.elasticsearch.node.internal.InternalNode;
|
||||||
import org.elasticsearch.test.integration.AbstractNodesTests;
|
import org.elasticsearch.test.integration.AbstractNodesTests;
|
||||||
import org.junit.*;
|
import org.junit.After;
|
||||||
|
import org.junit.Before;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import static org.elasticsearch.common.settings.ImmutableSettings.settingsBuilder;
|
import static org.elasticsearch.common.settings.ImmutableSettings.settingsBuilder;
|
||||||
import static org.hamcrest.MatcherAssert.assertThat;
|
|
||||||
import static org.hamcrest.Matchers.*;
|
import static org.hamcrest.Matchers.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -74,14 +74,14 @@ public class SimpleDistributorTests extends AbstractNodesTests {
|
||||||
createIndexWithStoreType("node1", "test", "niofs", "least_used");
|
createIndexWithStoreType("node1", "test", "niofs", "least_used");
|
||||||
String storeString = getStoreDirectory("node1", "test", 0).toString();
|
String storeString = getStoreDirectory("node1", "test", 0).toString();
|
||||||
logger.info(storeString);
|
logger.info(storeString);
|
||||||
assertThat(storeString, startsWith("store(least_used[rate_limited(niofs(" + dataPath1 ));
|
assertThat(storeString, startsWith("store(least_used[rate_limited(niofs(" + dataPath1));
|
||||||
assertThat(storeString, containsString("), rate_limited(niofs(" + dataPath2));
|
assertThat(storeString, containsString("), rate_limited(niofs(" + dataPath2));
|
||||||
assertThat(storeString, endsWith(", type=MERGE, rate=20.0)])"));
|
assertThat(storeString, endsWith(", type=MERGE, rate=20.0)])"));
|
||||||
|
|
||||||
createIndexWithStoreType("node1", "test", "niofs", "random");
|
createIndexWithStoreType("node1", "test", "niofs", "random");
|
||||||
storeString = getStoreDirectory("node1", "test", 0).toString();
|
storeString = getStoreDirectory("node1", "test", 0).toString();
|
||||||
logger.info(storeString);
|
logger.info(storeString);
|
||||||
assertThat(storeString, startsWith("store(random[rate_limited(niofs(" + dataPath1 ));
|
assertThat(storeString, startsWith("store(random[rate_limited(niofs(" + dataPath1));
|
||||||
assertThat(storeString, containsString("), rate_limited(niofs(" + dataPath2));
|
assertThat(storeString, containsString("), rate_limited(niofs(" + dataPath2));
|
||||||
assertThat(storeString, endsWith(", type=MERGE, rate=20.0)])"));
|
assertThat(storeString, endsWith(", type=MERGE, rate=20.0)])"));
|
||||||
|
|
||||||
|
@ -107,7 +107,7 @@ public class SimpleDistributorTests extends AbstractNodesTests {
|
||||||
createIndexWithoutRateLimitingStoreType("node1", "test", "niofs", "least_used");
|
createIndexWithoutRateLimitingStoreType("node1", "test", "niofs", "least_used");
|
||||||
storeString = getStoreDirectory("node1", "test", 0).toString();
|
storeString = getStoreDirectory("node1", "test", 0).toString();
|
||||||
logger.info(storeString);
|
logger.info(storeString);
|
||||||
assertThat(storeString, startsWith("store(least_used[niofs(" + dataPath1 ));
|
assertThat(storeString, startsWith("store(least_used[niofs(" + dataPath1));
|
||||||
assertThat(storeString, containsString("), niofs(" + dataPath2));
|
assertThat(storeString, containsString("), niofs(" + dataPath2));
|
||||||
assertThat(storeString, endsWith(")])"));
|
assertThat(storeString, endsWith(")])"));
|
||||||
}
|
}
|
||||||
|
@ -126,8 +126,7 @@ public class SimpleDistributorTests extends AbstractNodesTests {
|
||||||
.put("index.number_of_shards", 1)
|
.put("index.number_of_shards", 1)
|
||||||
)
|
)
|
||||||
.execute().actionGet();
|
.execute().actionGet();
|
||||||
assertThat(client("node1").admin().cluster().prepareHealth("test").setWaitForGreenStatus()
|
assertThat(client("node1").admin().cluster().prepareHealth("test").setWaitForGreenStatus().execute().actionGet().isTimedOut(), equalTo(false));
|
||||||
.setTimeout(TimeValue.timeValueSeconds(5)).execute().actionGet().isTimedOut(), equalTo(false));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createIndexWithoutRateLimitingStoreType(String nodeId, String index, String storeType, String distributor) {
|
private void createIndexWithoutRateLimitingStoreType(String nodeId, String index, String storeType, String distributor) {
|
||||||
|
@ -145,8 +144,7 @@ public class SimpleDistributorTests extends AbstractNodesTests {
|
||||||
.put("index.number_of_shards", 1)
|
.put("index.number_of_shards", 1)
|
||||||
)
|
)
|
||||||
.execute().actionGet();
|
.execute().actionGet();
|
||||||
assertThat(client("node1").admin().cluster().prepareHealth("test").setWaitForGreenStatus()
|
assertThat(client("node1").admin().cluster().prepareHealth("test").setWaitForGreenStatus().execute().actionGet().isTimedOut(), equalTo(false));
|
||||||
.setTimeout(TimeValue.timeValueSeconds(5)).execute().actionGet().isTimedOut(), equalTo(false));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private Directory getStoreDirectory(String nodeId, String index, int shardId) {
|
private Directory getStoreDirectory(String nodeId, String index, int shardId) {
|
||||||
|
|
Loading…
Reference in New Issue