XComp commented on code in PR #22935:
URL: https://github.com/apache/flink/pull/22935#discussion_r1254407986
##########
flink-runtime/src/test/java/org/apache/flink/runtime/leaderelection/ZooKeeperLeaderElectionTest.java:
##########
@@ -409,20 +408,19 @@ void testExceptionForwarding() throws Exception {
final TestingLeaderElectionListener electionEventHandler =
new TestingLeaderElectionListener();
- final TestingFatalErrorHandler fatalErrorHandler =
-
testingFatalErrorHandlerResource.getTestingFatalErrorHandler();
try (ZooKeeperLeaderElectionDriver leaderElectionDriver =
- createAndInitLeaderElectionDriver(
- client, electionEventHandler, fatalErrorHandler)) {
+ createAndInitLeaderElectionDriver(client,
electionEventHandler)) {
electionEventHandler.await(LeaderElectionEvent.IsLeaderEvent.class);
leaderElectionDriver.publishLeaderInformation(
CONTENDER_ID,
LeaderInformation.known(UUID.randomUUID(), "some-address"));
-
assertThat(fatalErrorHandler.getErrorFuture()).isCompletedWithValue(testException);
+ final LeaderElectionEvent.ErrorEvent errorEvent =
+
electionEventHandler.await(LeaderElectionEvent.ErrorEvent.class);
+ assertThat(errorEvent.getError()).isEqualTo(testException);
} finally {
- fatalErrorHandler.clearError();
+ electionEventHandler.throwIfErrorEventHappened();
Review Comment:
I pushed the changes related to your recommendation.
--
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]