Skip to content

Commit 11759e7

Browse files
committed
minor test fix
1 parent e6a5ad5 commit 11759e7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/action/filter/ShardBulkInferenceActionFilterTests.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ public void testItemFailures() throws Exception {
241241
);
242242
model.putResult(
243243
"I am a failure",
244-
new ChunkedInferenceError(new InferenceException("inference exception", new IllegalArgumentException("boom")))
244+
new ChunkedInferenceError(new IllegalArgumentException("boom"))
245245
);
246246
model.putResult("I am a success", randomChunkedInferenceEmbeddingSparse(List.of("I am a success")));
247247
CountDownLatch chainExecuted = new CountDownLatch(1);
@@ -255,8 +255,8 @@ public void testItemFailures() throws Exception {
255255
assertNotNull(bulkShardRequest.items()[0].getPrimaryResponse());
256256
assertTrue(bulkShardRequest.items()[0].getPrimaryResponse().isFailed());
257257
BulkItemResponse.Failure failure = bulkShardRequest.items()[0].getPrimaryResponse().getFailure();
258-
assertThat(failure.getCause().getCause().getMessage(), containsString("inference exception"));
259-
assertThat(failure.getCause().getCause().getCause().getMessage(), containsString("boom"));
258+
assertThat(failure.getCause().getMessage(), containsString("Exception when running inference"));
259+
assertThat(failure.getCause().getCause().getMessage(), containsString("boom"));
260260
assertThat(failure.getStatus(), is(RestStatus.BAD_REQUEST));
261261

262262
// item 1 is a success
@@ -276,8 +276,8 @@ public void testItemFailures() throws Exception {
276276
assertNotNull(bulkShardRequest.items()[2].getPrimaryResponse());
277277
assertTrue(bulkShardRequest.items()[2].getPrimaryResponse().isFailed());
278278
failure = bulkShardRequest.items()[2].getPrimaryResponse().getFailure();
279-
assertThat(failure.getCause().getCause().getMessage(), containsString("inference exception"));
280-
assertThat(failure.getCause().getCause().getCause().getMessage(), containsString("boom"));
279+
assertThat(failure.getCause().getMessage(), containsString("Exception when running inference"));
280+
assertThat(failure.getCause().getCause().getMessage(), containsString("boom"));
281281
assertThat(failure.getStatus(), is(RestStatus.BAD_REQUEST));
282282
} finally {
283283
chainExecuted.countDown();

0 commit comments

Comments
 (0)