Skip to content

Commit 23aaa90

Browse files
authored
Use different data stream name when simulating index template (#1949)
Use a different data stream name when simulating to check if synthetic is enabled. There seems to be some conflict if the same name is reused. Maybe related to elastic/elasticsearch#84256 or some similar issue.
1 parent 41addb9 commit 23aaa90

File tree

5 files changed

+7
-5
lines changed

5 files changed

+7
-5
lines changed

internal/testrunner/runners/system/testdata/elasticsearch-8-mock-synthetic-mode-couchdb.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ interactions:
7979
- go-elasticsearch/7.17.10 (linux amd64; Go 1.22.1)
8080
X-Elastic-Client-Meta:
8181
- es=7.17.10,go=1.22.1,t=7.17.10,hc=1.22.1
82-
url: https://127.0.0.1:9200/_index_template/_simulate_index/metrics-couchdb.server-12345
82+
url: https://127.0.0.1:9200/_index_template/_simulate_index/metrics-couchdb.server-12345simulated
8383
method: POST
8484
response:
8585
proto: HTTP/1.1

internal/testrunner/runners/system/testdata/elasticsearch-8-mock-synthetic-mode-dummy.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ interactions:
7979
- go-elasticsearch/7.17.10 (linux amd64; Go 1.22.1)
8080
X-Elastic-Client-Meta:
8181
- es=7.17.10,go=1.22.1,t=7.17.10,hc=1.22.1
82-
url: https://127.0.0.1:9200/_index_template/_simulate_index/logs-logs_synthetic_mode.synthetic-12345
82+
url: https://127.0.0.1:9200/_index_template/_simulate_index/logs-logs_synthetic_mode.synthetic-12345simulated
8383
method: POST
8484
response:
8585
proto: HTTP/1.1

internal/testrunner/runners/system/testdata/elasticsearch-8-mock-synthetic-mode-nginx-logsdb.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ interactions:
7979
- go-elasticsearch/7.17.10 (linux amd64; Go 1.22.1)
8080
X-Elastic-Client-Meta:
8181
- es=7.17.10,go=1.22.1,t=7.17.10,hc=1.22.1
82-
url: https://127.0.0.1:9200/_index_template/_simulate_index/logs-nginx.access-12345
82+
url: https://127.0.0.1:9200/_index_template/_simulate_index/logs-nginx.access-12345simulated
8383
method: POST
8484
response:
8585
proto: HTTP/1.1

internal/testrunner/runners/system/testdata/elasticsearch-8-mock-synthetic-mode-nginx.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ interactions:
7979
- go-elasticsearch/7.17.10 (linux amd64; Go 1.22.1)
8080
X-Elastic-Client-Meta:
8181
- es=7.17.10,go=1.22.1,t=7.17.10,hc=1.22.1
82-
url: https://127.0.0.1:9200/_index_template/_simulate_index/logs-nginx.access-12345
82+
url: https://127.0.0.1:9200/_index_template/_simulate_index/logs-nginx.access-12345simulated
8383
method: POST
8484
response:
8585
proto: HTTP/1.1

internal/testrunner/runners/system/tester.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,9 @@ func (r *tester) runTestPerVariant(ctx context.Context, result *testrunner.Resul
614614
}
615615

616616
func isSyntheticSourceModeEnabled(ctx context.Context, api *elasticsearch.API, dataStreamName string) (bool, error) {
617-
resp, err := api.Indices.SimulateIndexTemplate(dataStreamName,
617+
// We append a suffix so we don't use an existing resource, what may cause conflicts in old versions of
618+
// Elasticsearch, such as https://github.com/elastic/elasticsearch/issues/84256.
619+
resp, err := api.Indices.SimulateIndexTemplate(dataStreamName+"simulated",
618620
api.Indices.SimulateIndexTemplate.WithContext(ctx),
619621
)
620622
if err != nil {

0 commit comments

Comments
 (0)