Skip to content

Commit 626e806

Browse files
authored
Relax the testRequestResetAndAbort assertion (#70308) (#70550)
This relaxes the assertion to account for the case when the client executes the request successfully before we cancel the underlying http request. (cherry picked from commit 4b02e84) Signed-off-by: Andrei Dan <[email protected]>
1 parent a0d7cc7 commit 626e806

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

client/rest/src/test/java/org/elasticsearch/client/RestClientSingleHostIntegTests.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -295,11 +295,10 @@ public void testRequestResetAndAbort() throws Exception {
295295
httpGet.abort();
296296
assertTrue(httpGet.isAborted());
297297
try {
298-
assertTrue(future.isCancelled());
298+
assertTrue(future.isDone());
299299
future.get();
300-
throw new AssertionError("exception should have been thrown");
301300
} catch(CancellationException e) {
302-
//expected
301+
//expected sometimes - if the future was cancelled before executing successfully
303302
}
304303
}
305304
{

0 commit comments

Comments
 (0)