Skip to content

Commit

Permalink
Updating data streams rest tests to use a replica
Browse files Browse the repository at this point in the history
  • Loading branch information
masseyke committed Sep 22, 2023
1 parent 2cf4ead commit 70277a0
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public class TsdbDataStreamRestIT extends DisabledSecurityDataStreamTestCase {
"template": {
"settings":{
"index": {
"number_of_replicas": 0,
"number_of_replicas": 1,
"number_of_shards": 2,
"mode": "time_series"
}
Expand Down Expand Up @@ -117,7 +117,7 @@ public class TsdbDataStreamRestIT extends DisabledSecurityDataStreamTestCase {
"template": {
"settings":{
"index": {
"number_of_replicas": 0,
"number_of_replicas": 1,
"number_of_shards": 2
}
},
Expand Down Expand Up @@ -408,7 +408,7 @@ public void testSimulateTsdbDataStreamTemplate() throws Exception {
var responseBody = entityAsMap(response);
assertThat(ObjectPath.evaluate(responseBody, "template.settings.index"), aMapWithSize(6));
assertThat(ObjectPath.evaluate(responseBody, "template.settings.index.number_of_shards"), equalTo("2"));
assertThat(ObjectPath.evaluate(responseBody, "template.settings.index.number_of_replicas"), equalTo("0"));
assertThat(ObjectPath.evaluate(responseBody, "template.settings.index.number_of_replicas"), equalTo("1"));
assertThat(ObjectPath.evaluate(responseBody, "template.settings.index.mode"), equalTo("time_series"));
assertThat(ObjectPath.evaluate(responseBody, "template.settings.index.time_series.start_time"), notNullValue());
assertThat(ObjectPath.evaluate(responseBody, "template.settings.index.time_series.end_time"), notNullValue());
Expand Down Expand Up @@ -629,7 +629,7 @@ public void testLookBackTime() throws IOException {
"settings":{
"index": {
"look_back_time": "24h",
"number_of_replicas": 0,
"number_of_replicas": 1,
"mode": "time_series"
}
},
Expand Down Expand Up @@ -695,7 +695,7 @@ public void testReindexTsdbDataStream() throws Exception {
"template": {
"settings":{
"index": {
"number_of_replicas": 0,
"number_of_replicas": 1,
"number_of_shards": 4,
"mode": "time_series",
"routing_path": ["metricset", "k8s.pod.uid"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ protected Settings restClientSettings() {
@ClassRule
public static ElasticsearchCluster cluster = ElasticsearchCluster.local()
.distribution(DistributionType.DEFAULT)
.module("reindex")
.nodes(2)
.setting("indices.lifecycle.history_index_enabled", "false")
.setting("xpack.security.enabled", "true")
.keystore("bootstrap.password", "x-pack-test-password")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ setup:
index_patterns: [simple-data-stream1]
template:
settings:
index.number_of_replicas: 0
index.number_of_replicas: 1
data_stream: {}

- do:
Expand Down Expand Up @@ -43,6 +43,10 @@ setup:
name: simple-data-stream2
- is_true: acknowledged

- do:
cluster.health:
wait_for_status: green

- do:
indices.get_data_stream:
name: "*"
Expand Down Expand Up @@ -570,14 +574,18 @@ setup:
managed: true
template:
settings:
number_of_replicas: 0
number_of_replicas: 1
data_stream: {}

- do:
indices.create_data_stream:
name: logs-foobar
- is_true: acknowledged

- do:
cluster.health:
wait_for_status: green

- do:
indices.get_data_stream:
name: "*"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
index_patterns: [events-*]
template:
settings:
index.number_of_replicas: 0
index.number_of_replicas: 1
data_stream: {}

- do:
Expand Down Expand Up @@ -88,7 +88,7 @@
index_patterns: [ log-* ]
template:
settings:
index.number_of_replicas: 0
index.number_of_replicas: 1
data_stream: { }

- do:
Expand Down Expand Up @@ -168,7 +168,7 @@
index_patterns: [ log-* ]
template:
settings:
index.number_of_replicas: 0
index.number_of_replicas: 1
data_stream: { }

- do:
Expand Down Expand Up @@ -210,7 +210,7 @@
index_patterns: [ log-* ]
template:
settings:
index.number_of_replicas: 0
index.number_of_replicas: 1
data_stream: { }

- do:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ setup:
settings:
index:
mode: time_series
number_of_replicas: 0
number_of_replicas: 1
number_of_shards: 2
routing_path: [metricset, time_series_dimension]
time_series:
Expand Down Expand Up @@ -90,6 +90,10 @@ created the data stream:
version: " - 8.0.99"
reason: introduced in 8.1.0

- do:
cluster.health:
wait_for_status: green

- do:
indices.get_data_stream:
name: '*'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
template:
settings:
number_of_shards: 1
number_of_replicas: 0
number_of_replicas: 1

- do:
index:
Expand Down

0 comments on commit 70277a0

Please sign in to comment.