zentol commented on code in PR #19993:
URL: https://github.com/apache/flink/pull/19993#discussion_r901611238
##########
flink-runtime/src/test/java/org/apache/flink/runtime/checkpoint/channel/ChannelStateWriteRequestExecutorImplTest.java:
##########
@@ -128,12 +131,33 @@ public void testIgnoresInterruptsWhileRunning() throws
Exception {
}
}
- @Test
- public void testCanBeClosed() throws IOException {
- TestRequestDispatcher requestProcessor = new TestRequestDispatcher();
+ @Test(timeout = 10000)
Review Comment:
```suggestion
@Test
```
We don't use timeouts in tests
##########
flink-runtime/src/test/java/org/apache/flink/runtime/checkpoint/channel/ChannelStateWriteRequestExecutorImplTest.java:
##########
@@ -128,12 +131,33 @@ public void testIgnoresInterruptsWhileRunning() throws
Exception {
}
}
- @Test
- public void testCanBeClosed() throws IOException {
- TestRequestDispatcher requestProcessor = new TestRequestDispatcher();
+ @Test(timeout = 10000)
+ public void testCanBeClosed() throws Exception {
+ long checkpointId = 1L;
+ ChannelStateWriteRequestDispatcher processor =
+ new ChannelStateWriteRequestDispatcherImpl(
+ "dummy task",
+ 0,
+ getStreamFactoryFactory(),
+ new ChannelStateSerializerImpl());
try (ChannelStateWriteRequestExecutorImpl worker =
- new ChannelStateWriteRequestExecutorImpl(TASK_NAME,
requestProcessor)) {
+ new ChannelStateWriteRequestExecutorImpl(TASK_NAME,
processor)) {
worker.start();
+ worker.submit(
+ new CheckpointStartRequest(
+ checkpointId,
+ new ChannelStateWriter.ChannelStateWriteResult(),
+ CheckpointStorageLocationReference.getDefault()));
+ worker.submit(
+ ChannelStateWriteRequest.write(
+ checkpointId,
+ new ResultSubpartitionInfo(0, 0),
+ new CompletableFuture<>()));
+ worker.submit(
+ ChannelStateWriteRequest.write(
+ checkpointId,
+ new ResultSubpartitionInfo(0, 0),
+ new CompletableFuture<>()));
Review Comment:
Is this actually required for the test or just a duplicate?
If it isn't required I would remove it.
##########
flink-runtime/src/test/java/org/apache/flink/runtime/checkpoint/channel/ChannelStateWriteRequestExecutorImplTest.java:
##########
@@ -128,12 +131,33 @@ public void testIgnoresInterruptsWhileRunning() throws
Exception {
}
}
- @Test
- public void testCanBeClosed() throws IOException {
- TestRequestDispatcher requestProcessor = new TestRequestDispatcher();
+ @Test(timeout = 10000)
+ public void testCanBeClosed() throws Exception {
+ long checkpointId = 1L;
+ ChannelStateWriteRequestDispatcher processor =
Review Comment:
Why can we no longer use the `TestRequestDispatcher`?
--
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]