tillrohrmann commented on a change in pull request #9242: [FLINK-13408][runtime] Schedule StandaloneResourceManager.setFailUnfulfillableRequest whenever the leadership is acquired URL: https://github.com/apache/flink/pull/9242#discussion_r308443635
########## File path: flink-runtime/src/test/java/org/apache/flink/runtime/resourcemanager/StandaloneResourceManagerTest.java ########## @@ -83,6 +83,21 @@ public void testNoStartupPeriod() throws Exception { rm.close(); } + @Test + public void testStartUpPeriodAfterLeadershipSwitch() throws Exception { + final TestingStandaloneResourceManager rm = createResourceManager(Time.milliseconds(1L)); + + final Deadline deadline1 = Deadline.fromNow(Duration.ofSeconds(10L)); + assertHappensUntil(() -> rm.isFailingUnfulfillableRequestAsync().join(), deadline1); + + rm.rmServices.revokeLeadership(); + + rm.rmServices.grantLeadership(); + + final Deadline deadline3 = Deadline.fromNow(Duration.ofSeconds(10L)); + assertHappensUntil(() -> rm.isFailingUnfulfillableRequestAsync().join(), deadline3); Review comment: I think the test does not really ensure that we start a new startup period after granting the second leadership. It could also be the case that the timeout won't be reset. I think it would be better to pass in a TestingSlotManager on which we verify the behavior (e.g. that certain methods are being called) ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services