Skip to content

Commit

Permalink
Use different data stream name when simulating index template (#1949)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jsoriano authored Jul 4, 2024
1 parent 41addb9 commit 23aaa90
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ interactions:
- go-elasticsearch/7.17.10 (linux amd64; Go 1.22.1)
X-Elastic-Client-Meta:
- es=7.17.10,go=1.22.1,t=7.17.10,hc=1.22.1
url: https://127.0.0.1:9200/_index_template/_simulate_index/metrics-couchdb.server-12345
url: https://127.0.0.1:9200/_index_template/_simulate_index/metrics-couchdb.server-12345simulated
method: POST
response:
proto: HTTP/1.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ interactions:
- go-elasticsearch/7.17.10 (linux amd64; Go 1.22.1)
X-Elastic-Client-Meta:
- es=7.17.10,go=1.22.1,t=7.17.10,hc=1.22.1
url: https://127.0.0.1:9200/_index_template/_simulate_index/logs-logs_synthetic_mode.synthetic-12345
url: https://127.0.0.1:9200/_index_template/_simulate_index/logs-logs_synthetic_mode.synthetic-12345simulated
method: POST
response:
proto: HTTP/1.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ interactions:
- go-elasticsearch/7.17.10 (linux amd64; Go 1.22.1)
X-Elastic-Client-Meta:
- es=7.17.10,go=1.22.1,t=7.17.10,hc=1.22.1
url: https://127.0.0.1:9200/_index_template/_simulate_index/logs-nginx.access-12345
url: https://127.0.0.1:9200/_index_template/_simulate_index/logs-nginx.access-12345simulated
method: POST
response:
proto: HTTP/1.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ interactions:
- go-elasticsearch/7.17.10 (linux amd64; Go 1.22.1)
X-Elastic-Client-Meta:
- es=7.17.10,go=1.22.1,t=7.17.10,hc=1.22.1
url: https://127.0.0.1:9200/_index_template/_simulate_index/logs-nginx.access-12345
url: https://127.0.0.1:9200/_index_template/_simulate_index/logs-nginx.access-12345simulated
method: POST
response:
proto: HTTP/1.1
Expand Down
4 changes: 3 additions & 1 deletion internal/testrunner/runners/system/tester.go
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,9 @@ func (r *tester) runTestPerVariant(ctx context.Context, result *testrunner.Resul
}

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

0 comments on commit 23aaa90

Please sign in to comment.