Skip to content

Commit 8330c86

Browse files
jan-elasticelasticsearchmachine
andauthored
Fix(?) and unmute DatafeedJobsRestIT. (#119839)
* Fix(?) and unmute DatafeedJobsRestIT. * [CI] Auto commit changes from spotless --------- Co-authored-by: elasticsearchmachine <[email protected]>
1 parent 750a0ab commit 8330c86

File tree

2 files changed

+12
-18
lines changed

2 files changed

+12
-18
lines changed

muted-tests.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,6 @@ tests:
8484
issue: https://github.com/elastic/elasticsearch/issues/115816
8585
- class: org.elasticsearch.xpack.application.connector.ConnectorIndexServiceTests
8686
issue: https://github.com/elastic/elasticsearch/issues/116087
87-
- class: org.elasticsearch.xpack.ml.integration.DatafeedJobsRestIT
88-
method: testLookbackWithIndicesOptions
89-
issue: https://github.com/elastic/elasticsearch/issues/116127
9087
- class: org.elasticsearch.xpack.test.rest.XPackRestIT
9188
method: test {p0=transform/transforms_start_stop/Test start already started transform}
9289
issue: https://github.com/elastic/elasticsearch/issues/98802
@@ -152,8 +149,6 @@ tests:
152149
- class: org.elasticsearch.test.rest.yaml.CcsCommonYamlTestSuiteIT
153150
method: test {p0=search.highlight/50_synthetic_source/text multi unified from vectors}
154151
issue: https://github.com/elastic/elasticsearch/issues/117815
155-
- class: org.elasticsearch.xpack.ml.integration.DatafeedJobsRestIT
156-
issue: https://github.com/elastic/elasticsearch/issues/111319
157152
- class: org.elasticsearch.xpack.esql.plugin.ClusterRequestTests
158153
method: testFallbackIndicesOptions
159154
issue: https://github.com/elastic/elasticsearch/issues/117937

x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/DatafeedJobsRestIT.java

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
import static org.hamcrest.Matchers.anyOf;
3838
import static org.hamcrest.Matchers.containsString;
3939
import static org.hamcrest.Matchers.equalTo;
40-
import static org.hamcrest.Matchers.not;
4140

4241
public class DatafeedJobsRestIT extends ESRestTestCase {
4342

@@ -503,12 +502,12 @@ public void testLookbackWithIndicesOptions() throws Exception {
503502
}""");
504503
client().performRequest(createJobRequest);
505504
String datafeedId = jobId + "-datafeed";
506-
new DatafeedBuilder(datafeedId, jobId, "*hidden-*").setIndicesOptions("""
505+
new DatafeedBuilder(datafeedId, jobId, "hidden-*").setIndicesOptions("""
507506
{"expand_wildcards": ["all"],"allow_no_indices": true}""").build();
508507

509508
StringBuilder bulk = new StringBuilder();
510509

511-
Request createGeoData = new Request("PUT", "/.hidden-index");
510+
Request createGeoData = new Request("PUT", "/hidden-index");
512511
createGeoData.setJsonEntity("""
513512
{
514513
"mappings": {
@@ -528,23 +527,23 @@ public void testLookbackWithIndicesOptions() throws Exception {
528527
client().performRequest(createGeoData);
529528

530529
bulk.append("""
531-
{"index": {"_index": ".hidden-index", "_id": 1}}
530+
{"index": {"_index": "hidden-index", "_id": 1}}
532531
{"time":"2016-06-01T00:00:00Z","value": 1000}
533-
{"index": {"_index": ".hidden-index", "_id": 2}}
532+
{"index": {"_index": "hidden-index", "_id": 2}}
534533
{"time":"2016-06-01T00:05:00Z","value":1500}
535-
{"index": {"_index": ".hidden-index", "_id": 3}}
534+
{"index": {"_index": "hidden-index", "_id": 3}}
536535
{"time":"2016-06-01T00:10:00Z","value":1600}
537-
{"index": {"_index": ".hidden-index", "_id": 4}}
536+
{"index": {"_index": "hidden-index", "_id": 4}}
538537
{"time":"2016-06-01T00:15:00Z","value":100}
539-
{"index": {"_index": ".hidden-index", "_id": 5}}
538+
{"index": {"_index": "hidden-index", "_id": 5}}
540539
{"time":"2016-06-01T00:20:00Z","value":1}
541-
{"index": {"_index": ".hidden-index", "_id": 6}}
540+
{"index": {"_index": "hidden-index", "_id": 6}}
542541
{"time":"2016-06-01T00:25:00Z","value":1500}
543-
{"index": {"_index": ".hidden-index", "_id": 7}}
542+
{"index": {"_index": "hidden-index", "_id": 7}}
544543
{"time":"2016-06-01T00:30:00Z","value":1500}
545-
{"index": {"_index": ".hidden-index", "_id": 8}}
544+
{"index": {"_index": "hidden-index", "_id": 8}}
546545
{"time":"2016-06-01T00:40:00Z","value":2100}
547-
{"index": {"_index": ".hidden-index", "_id": 9}}
546+
{"index": {"_index": "hidden-index", "_id": 9}}
548547
{"time":"2016-06-01T00:41:00Z","value":0}
549548
""");
550549
bulkIndex(bulk.toString());
@@ -1802,7 +1801,7 @@ private void bulkIndex(String bulk) throws IOException {
18021801
bulkRequest.addParameter("refresh", "true");
18031802
bulkRequest.addParameter("pretty", null);
18041803
String bulkResponse = EntityUtils.toString(client().performRequest(bulkRequest).getEntity());
1805-
assertThat(bulkResponse, not(containsString("\"errors\": false")));
1804+
assertThat(bulkResponse, containsString("\"errors\" : false"));
18061805
}
18071806

18081807
private Response createJobAndDataFeed(String jobId, String datafeedId) throws IOException {

0 commit comments

Comments
 (0)