Skip to content

Commit b49564d

Browse files
authored
Unwrap failure in testCancelRequestWhenFailingFetchingPages (#121597) (#121615)
The thrown exception may be wrapped in an ExecutionException; therefore, we need to unwrap it before verification. Closes #121596 Closes #118193
1 parent 9c42846 commit b49564d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

x-pack/plugin/esql/src/internalClusterTest/java/org/elasticsearch/xpack/esql/action/EsqlActionTaskIT.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,9 @@ protected void doRun() throws Exception {
432432
}
433433
Exception failure = expectThrows(Exception.class, () -> future.actionGet().close());
434434
EsqlTestUtils.assertEsqlFailure(failure);
435-
assertThat(failure.getMessage(), containsString("failed to fetch pages"));
435+
Throwable cause = ExceptionsHelper.unwrap(failure, IOException.class);
436+
assertNotNull(cause);
437+
assertThat(cause.getMessage(), containsString("failed to fetch pages"));
436438
// If we proceed without waiting for pages, we might cancel the main request before starting the data-node request.
437439
// As a result, the exchange sinks on data-nodes won't be removed until the inactive_timeout elapses, which is
438440
// longer than the assertBusy timeout.

0 commit comments

Comments
 (0)