steveloughran commented on code in PR #4704:
URL: https://github.com/apache/hadoop/pull/4704#discussion_r940079934
##########
hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/contract/AbstractContractVectoredReadTest.java:
##########
@@ -281,16 +281,7 @@ public void testEOFRanges() throws Exception {
in.readVectored(fileRanges, allocate);
for (FileRange res : fileRanges) {
CompletableFuture<ByteBuffer> data = res.getData();
- try {
- ByteBuffer buffer = data.get();
- // Shouldn't reach here.
- Assert.fail("EOFException must be thrown while reading EOF");
- } catch (ExecutionException ex) {
- // ignore as expected.
- } catch (Exception ex) {
- LOG.error("Exception while running vectored read ", ex);
- Assert.fail("Exception while running vectored read " + ex);
- }
+ intercept(ExecutionException.class, (Callable<ByteBuffer>) data::get);
Review Comment:
there's an interceptFuture() variant where you can also specify the timeout
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]