File tree Expand file tree Collapse file tree 4 files changed +19
-15
lines changed
test/framework/src/main/java/org/elasticsearch/test
qa/inference-service-tests/src/javaRestTest/java/org/elasticsearch/xpack/inference
src/yamlRestTest/java/org/elasticsearch/xpack/inference Expand file tree Collapse file tree 4 files changed +19
-15
lines changed Original file line number Diff line number Diff line change @@ -73,15 +73,6 @@ tests:
7373- class : org.elasticsearch.xpack.apmdata.APMYamlTestSuiteIT
7474 method : test {yaml=/10_apm/Test template reinstallation}
7575 issue : https://github.com/elastic/elasticsearch/issues/116445
76- - class : org.elasticsearch.xpack.inference.InferenceRestIT
77- method : test {p0=inference/40_semantic_text_query/Query a field that uses the default ELSER 2 endpoint}
78- issue : https://github.com/elastic/elasticsearch/issues/117027
79- - class : org.elasticsearch.xpack.inference.InferenceRestIT
80- method : test {p0=inference/30_semantic_text_inference/Calculates embeddings using the default ELSER 2 endpoint}
81- issue : https://github.com/elastic/elasticsearch/issues/117349
82- - class : org.elasticsearch.xpack.inference.InferenceRestIT
83- method : test {p0=inference/30_semantic_text_inference_bwc/Calculates embeddings using the default ELSER 2 endpoint}
84- issue : https://github.com/elastic/elasticsearch/issues/117349
8576- class : org.elasticsearch.xpack.test.rest.XPackRestIT
8677 method : test {p0=transform/transforms_reset/Test reset running transform}
8778 issue : https://github.com/elastic/elasticsearch/issues/117473
Original file line number Diff line number Diff line change 11/*
22 * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3- * or more contributor license agreements. Licensed under the Elastic License
4- * 2.0; you may not use this file except in compliance with the Elastic License
5- * 2.0.
3+ * or more contributor license agreements. Licensed under the "Elastic License
4+ * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
5+ * Public License v 1"; you may not use this file except in compliance with, at
6+ * your election, the "Elastic License 2.0", the "GNU Affero General Public
7+ * License v3.0 only", or the "Server Side Public License, v 1".
68 */
79
8- package org .elasticsearch .xpack . inference ;
10+ package org .elasticsearch .test ;
911
1012import org .apache .logging .log4j .LogManager ;
1113import org .apache .logging .log4j .Logger ;
2527 * <br/>
2628 * <code>public RetryRule retry = new RetryRule(3, TimeValue.timeValueSeconds(1));</code>
2729 * <br/>
28- * See {@link InferenceGetServicesIT#retry} for an example.
2930 */
3031public class RetryRule implements TestRule {
3132 private static final Logger logger = LogManager .getLogger (RetryRule .class );
Original file line number Diff line number Diff line change 1313import org .elasticsearch .common .settings .Settings ;
1414import org .elasticsearch .common .util .concurrent .ThreadContext ;
1515import org .elasticsearch .core .TimeValue ;
16+ import org .elasticsearch .test .RetryRule ;
1617import org .elasticsearch .test .cluster .ElasticsearchCluster ;
1718import org .elasticsearch .test .cluster .local .distribution .DistributionType ;
1819import org .elasticsearch .test .rest .ESRestTestCase ;
@@ -54,7 +55,7 @@ public class BaseMockEISAuthServerTest extends ESRestTestCase {
5455
5556 // The reason we're retrying is there's a race condition between the node retrieving the
5657 // authorization response and running the test. Retrieving the authorization should be very fast since
57- // we're hosting a local mock server but it's possible it could respond slower. So in the even of a test failure
58+ // we're hosting a local mock server but it's possible it could respond slower. So in the event of a test failure
5859 // we'll automatically retry after waiting a second.
5960 // Note: @Rule is executed for each test
6061 @ Rule
Original file line number Diff line number Diff line change 1212import org .elasticsearch .client .Request ;
1313import org .elasticsearch .common .Strings ;
1414import org .elasticsearch .common .settings .Settings ;
15+ import org .elasticsearch .core .TimeValue ;
16+ import org .elasticsearch .test .RetryRule ;
1517import org .elasticsearch .test .cluster .ElasticsearchCluster ;
1618import org .elasticsearch .test .cluster .FeatureFlag ;
1719import org .elasticsearch .test .cluster .local .distribution .DistributionType ;
1820import org .elasticsearch .test .rest .yaml .ClientYamlTestCandidate ;
1921import org .elasticsearch .test .rest .yaml .ESClientYamlSuiteTestCase ;
2022import org .junit .After ;
2123import org .junit .ClassRule ;
24+ import org .junit .Rule ;
2225
2326import java .io .IOException ;
2427import java .util .List ;
@@ -37,6 +40,14 @@ public class InferenceRestIT extends ESClientYamlSuiteTestCase {
3740 .distribution (DistributionType .DEFAULT )
3841 .build ();
3942
43+ /**
44+ * This will retry a failed test up to 3 times with a 1 second wait between retries. We've observed transient network
45+ * failures when trying to download the elser model during the test. These network failure cause the tests to fail intermittently.
46+ * The proper way to fix this would be to add retry logic to the download code but that is a larger fix.
47+ */
48+ @ Rule
49+ public RetryRule retryRule = new RetryRule (3 , TimeValue .timeValueSeconds (1 ));
50+
4051 public InferenceRestIT (final ClientYamlTestCandidate testCandidate ) {
4152 super (testCandidate );
4253 }
You can’t perform that action at this time.
0 commit comments