Repository: flink Updated Branches: refs/heads/master f48f5340a -> eef0db090
[hotfix] Harden TaskExecutorTest#testSlotAcceptance The test did not properly wait for the registration of the TaskExecutor at the ResourceManager. Therefore, it could come to a race condition between sending an initial SlotReport and a separate message for the newly added slots. Project: http://git-wip-us.apache.org/repos/asf/flink/repo Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/eef0db09 Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/eef0db09 Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/eef0db09 Branch: refs/heads/master Commit: eef0db090021ab2629703b6c5210a36a5f7c9777 Parents: f48f534 Author: Till Rohrmann <[email protected]> Authored: Wed Oct 11 18:21:52 2017 +0200 Committer: Till Rohrmann <[email protected]> Committed: Wed Oct 11 18:23:37 2017 +0200 ---------------------------------------------------------------------- .../apache/flink/runtime/taskexecutor/TaskExecutorTest.java | 7 +++++++ 1 file changed, 7 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flink/blob/eef0db09/flink-runtime/src/test/java/org/apache/flink/runtime/taskexecutor/TaskExecutorTest.java ---------------------------------------------------------------------- diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/taskexecutor/TaskExecutorTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/taskexecutor/TaskExecutorTest.java index 0413496..5b80dd5 100644 --- a/flink-runtime/src/test/java/org/apache/flink/runtime/taskexecutor/TaskExecutorTest.java +++ b/flink-runtime/src/test/java/org/apache/flink/runtime/taskexecutor/TaskExecutorTest.java @@ -992,6 +992,13 @@ public class TaskExecutorTest extends TestLogger { try { taskManager.start(); + // wait for the registration at the ResourceManager + verify(resourceManagerGateway, Mockito.timeout(timeout.toMilliseconds())).registerTaskExecutor( + eq(taskManager.getAddress()), + eq(resourceId), + any(SlotReport.class), + any(Time.class)); + taskSlotTable.allocateSlot(0, jobId, allocationId1, Time.milliseconds(10000L)); taskSlotTable.allocateSlot(1, jobId, allocationId2, Time.milliseconds(10000L));
