XComp commented on a change in pull request #19116:
URL: https://github.com/apache/flink/pull/19116#discussion_r837141717



##########
File path: 
flink-kubernetes/src/test/java/org/apache/flink/kubernetes/kubeclient/resources/TestingLeaderCallbackHandler.java
##########
@@ -63,38 +59,23 @@ public boolean hasLeadership() {
         return isLeader;
     }
 
-    public static String waitUntilNewLeaderAppears(long timeout) throws 
Exception {
-        final AtomicReference<String> leaderRef = new AtomicReference<>();
-        CommonTestUtils.waitUntilCondition(
-                () -> {
-                    final String lockIdentity = sharedQueue.poll(timeout, 
TimeUnit.MILLISECONDS);
-                    leaderRef.set(lockIdentity);
-                    return lockIdentity != null;

Review comment:
       I was wondering whether we should add a null check in the constructor to 
comply to the previous implementation (ignoring `null` values). But 
`BlockingQueue`s don't accept `null` as values, anyway. The only benefit we 
gain from it is that we would fail earlier (in the constructor rather than the 
`offer` calls) if somebody "accidentally" used `null` as a `lockIdentity`. but 
that's probably off-topic to this change, anyway. So, I leave it up to you...




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