Skip to content

Commit d467eab

Browse files
Fixing flaky tests
1 parent 926c4fe commit d467eab

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

x-pack/plugin/inference/src/internalClusterTest/java/org/elasticsearch/xpack/inference/integration/InferenceIndicesIT.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,11 +168,10 @@ public void testRetrievingInferenceEndpoint_ThrowsException_WhenIndexNodeIsNotAv
168168

169169
var proxyResponse = sendInferenceProxyRequest(inferenceId);
170170
var exception = expectThrows(ElasticsearchException.class, () -> proxyResponse.actionGet(TEST_REQUEST_TIMEOUT));
171-
assertThat(exception.toString(), containsString("Failed to load inference endpoint [test-index-id-2]"));
171+
assertThat(exception.toString(), containsString("Failed to load inference endpoint with secrets [test-index-id-2]"));
172172

173173
var causeException = exception.getCause();
174174
assertThat(causeException, instanceOf(SearchPhaseExecutionException.class));
175-
assertThat(causeException.toString(), containsString(".inference"));
176175
}
177176

178177
public void testRetrievingInferenceEndpoint_ThrowsException_WhenSecretsIndexNodeIsNotAvailable() throws Exception {
@@ -198,12 +197,11 @@ public void testRetrievingInferenceEndpoint_ThrowsException_WhenSecretsIndexNode
198197
var proxyResponse = sendInferenceProxyRequest(inferenceId);
199198

200199
var exception = expectThrows(ElasticsearchException.class, () -> proxyResponse.actionGet(TEST_REQUEST_TIMEOUT));
201-
assertThat(exception.toString(), containsString("Failed to load inference endpoint [test-secrets-index-id]"));
200+
assertThat(exception.toString(), containsString("Failed to load inference endpoint with secrets [test-secrets-index-id]"));
202201

203202
var causeException = exception.getCause();
204203

205204
assertThat(causeException, instanceOf(SearchPhaseExecutionException.class));
206-
assertThat(causeException.toString(), containsString(".secrets-inference"));
207205
}
208206

209207
private ActionFuture<InferenceAction.Response> sendInferenceProxyRequest(String inferenceId) throws IOException {

x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/registry/ModelRegistry.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,10 +263,10 @@ public void getModelWithSecrets(String inferenceEntityId, ActionListener<Unparse
263263

264264
listener.onResponse(unparsedModelFromMap(createModelConfigMap(searchResponse.getHits(), inferenceEntityId)));
265265
}, (e) -> {
266-
logger.warn(format("Failed to load inference endpoint [%s]", inferenceEntityId), e);
266+
logger.warn(format("Failed to load inference endpoint with secrets [%s]", inferenceEntityId), e);
267267
listener.onFailure(
268268
new ElasticsearchException(
269-
format("Failed to load inference endpoint [%s], error: [%s]", inferenceEntityId, e.getMessage()),
269+
format("Failed to load inference endpoint with secrets [%s], error: [%s]", inferenceEntityId, e.getMessage()),
270270
e
271271
)
272272
);

0 commit comments

Comments
 (0)