mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-17 02:14:54 +00:00
improve test time
This commit is contained in:
parent
24d5a758f0
commit
5ecb847a3a
@ -257,8 +257,8 @@ public abstract class AbstractSimpleIndexGatewayTests extends AbstractNodesTests
|
|||||||
client("server1").admin().indices().prepareRefresh().execute().actionGet();
|
client("server1").admin().indices().prepareRefresh().execute().actionGet();
|
||||||
assertThat(client("server1").prepareCount().setQuery(matchAllQuery()).execute().actionGet().count(), equalTo(0l));
|
assertThat(client("server1").prepareCount().setQuery(matchAllQuery()).execute().actionGet().count(), equalTo(0l));
|
||||||
|
|
||||||
logger.info("--> indexing 12345 docs");
|
logger.info("--> indexing 1234 docs");
|
||||||
for (long i = 0; i < 12345; i++) {
|
for (long i = 0; i < 1234; i++) {
|
||||||
client("server1").prepareIndex("test", "type1", Long.toString(i))
|
client("server1").prepareIndex("test", "type1", Long.toString(i))
|
||||||
.setCreate(true) // make sure we use create, so if we recover wrongly, we will get increments...
|
.setCreate(true) // make sure we use create, so if we recover wrongly, we will get increments...
|
||||||
.setSource(MapBuilder.<String, Object>newMapBuilder().put("test", "value" + i).map()).execute().actionGet();
|
.setSource(MapBuilder.<String, Object>newMapBuilder().put("test", "value" + i).map()).execute().actionGet();
|
||||||
@ -267,11 +267,15 @@ public abstract class AbstractSimpleIndexGatewayTests extends AbstractNodesTests
|
|||||||
if ((i % 11) == 0) {
|
if ((i % 11) == 0) {
|
||||||
client("server1").admin().indices().prepareGatewaySnapshot().execute().actionGet();
|
client("server1").admin().indices().prepareGatewaySnapshot().execute().actionGet();
|
||||||
}
|
}
|
||||||
|
// flush every once is a while, so we get different data
|
||||||
|
if ((i % 55) == 0) {
|
||||||
|
client("server1").admin().indices().prepareFlush().execute().actionGet();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.info("--> refreshing and checking count");
|
logger.info("--> refreshing and checking count");
|
||||||
client("server1").admin().indices().prepareRefresh().execute().actionGet();
|
client("server1").admin().indices().prepareRefresh().execute().actionGet();
|
||||||
assertThat(client("server1").prepareCount().setQuery(matchAllQuery()).execute().actionGet().count(), equalTo(12345l));
|
assertThat(client("server1").prepareCount().setQuery(matchAllQuery()).execute().actionGet().count(), equalTo(1234l));
|
||||||
|
|
||||||
|
|
||||||
logger.info("--> closing the server");
|
logger.info("--> closing the server");
|
||||||
@ -291,7 +295,7 @@ public abstract class AbstractSimpleIndexGatewayTests extends AbstractNodesTests
|
|||||||
assertThat(clusterHealth.status(), equalTo(ClusterHealthStatus.YELLOW));
|
assertThat(clusterHealth.status(), equalTo(ClusterHealthStatus.YELLOW));
|
||||||
|
|
||||||
logger.info("--> checking count");
|
logger.info("--> checking count");
|
||||||
assertThat(client("server1").prepareCount().setQuery(matchAllQuery()).execute().actionGet().count(), equalTo(12345l));
|
assertThat(client("server1").prepareCount().setQuery(matchAllQuery()).execute().actionGet().count(), equalTo(1234l));
|
||||||
|
|
||||||
logger.info("--> checking reuse / recovery status");
|
logger.info("--> checking reuse / recovery status");
|
||||||
IndicesStatusResponse statusResponse = client("server1").admin().indices().prepareStatus().execute().actionGet();
|
IndicesStatusResponse statusResponse = client("server1").admin().indices().prepareStatus().execute().actionGet();
|
||||||
|
@ -4,7 +4,7 @@ cluster:
|
|||||||
gateway:
|
gateway:
|
||||||
type: fs
|
type: fs
|
||||||
fs:
|
fs:
|
||||||
buffer_size: 3b
|
buffer_size: 1kb
|
||||||
index:
|
index:
|
||||||
number_of_shards: 1
|
number_of_shards: 1
|
||||||
number_of_replicas: 1
|
number_of_replicas: 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user