XComp commented on code in PR #22844:
URL: https://github.com/apache/flink/pull/22844#discussion_r1251576723


##########
flink-runtime/src/test/java/org/apache/flink/runtime/leaderelection/DefaultLeaderElectionServiceTest.java:
##########
@@ -597,14 +676,30 @@ void 
testOnLeaderInformationChangeIsIgnoredAfterLeaderElectionBeingStop() throws
                         () -> {
                             grantLeadership();
 
-                            
assertThat(storedLeaderInformation.get().forContenderID(contenderID))
-                                    .isPresent();
+                            applyToBothContenderContexts(
+                                    ctx ->
+                                            assertThat(
+                                                            
storedLeaderInformation
+                                                                    .get()
+                                                                    
.forContenderID(
+                                                                            
ctx.contenderID))
+                                                    .isPresent());
+
+                            contenderContext0.leaderElection.close();

Review Comment:
   Because it checked also the other contender which the test expects to be 
corrected after the first close call. But I noticed that this isn't the right 
behavior: We shouldn't touch the LeaderInformation for a contender that wasn't 
mentioned in the `notifyLeaderInformationChange` call. I have to revisit the 
behavior of the leaderinformation change event handling



-- 
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]

Reply via email to