Skip to content

Commit a65a68d

Browse files
committed
using interceptFuture with timeout
1 parent fef7f5f commit a65a68d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/contract/AbstractContractVectoredReadTest.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import java.util.concurrent.Callable;
2727
import java.util.concurrent.CompletableFuture;
2828
import java.util.concurrent.ExecutionException;
29+
import java.util.concurrent.TimeUnit;
2930
import java.util.function.IntFunction;
3031

3132
import org.assertj.core.api.Assertions;
@@ -50,6 +51,7 @@
5051
import static org.apache.hadoop.fs.contract.ContractTestUtils.returnBuffersToPoolPostRead;
5152
import static org.apache.hadoop.fs.contract.ContractTestUtils.validateVectoredReadResult;
5253
import static org.apache.hadoop.test.LambdaTestUtils.intercept;
54+
import static org.apache.hadoop.test.LambdaTestUtils.interceptFuture;
5355

5456
@RunWith(Parameterized.class)
5557
public abstract class AbstractContractVectoredReadTest extends AbstractFSContractTestBase {
@@ -281,7 +283,11 @@ public void testEOFRanges() throws Exception {
281283
in.readVectored(fileRanges, allocate);
282284
for (FileRange res : fileRanges) {
283285
CompletableFuture<ByteBuffer> data = res.getData();
284-
intercept(ExecutionException.class, (Callable<ByteBuffer>) data::get);
286+
interceptFuture(ExecutionException.class,
287+
"",
288+
ContractTestUtils.VECTORED_READ_OPERATION_TEST_TIMEOUT_SECONDS,
289+
TimeUnit.SECONDS,
290+
data);
285291
}
286292
}
287293
}

0 commit comments

Comments
 (0)