deniskuzZ commented on code in PR #6142:
URL: https://github.com/apache/hive/pull/6142#discussion_r2465530889
##########
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/leader/TestLeaderElection.java:
##########
@@ -98,60 +90,21 @@ public void testLeaseLeaderElection() throws Exception {
// elect1 as a leader now
assertTrue(flag1.get() && instance1.isLeader());
- configuration.setBoolean(LeaseLeaderElection.METASTORE_RENEW_LEASE, true);
LeaseLeaderElection instance2 = new LeaseLeaderElection();
AtomicBoolean flag2 = new AtomicBoolean(false);
instance2.addStateListener(new TestLeaderListener(flag2));
instance2.tryBeLeader(configuration, mutex);
// instance2 should not be leader as elect1 holds the lease
assertFalse(flag2.get() || instance2.isLeader());
- ExecutorService service = Executors.newFixedThreadPool(4);
- wait(service, flag1, flag2);
- // now instance1 lease is timeout, the instance2 should be leader now
+ instance1.close();
+ synchronized (flag2) {
Review Comment:
sorry, I meant `Ref<Boolean>`, but it's seem only available in hive modules
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]