@@ -298,20 +298,29 @@ public void testJoinElectedLeader() {
298298 public void testJoinAccumulation () {
299299 DiscoveryNode node0 = newNode (0 , true );
300300 DiscoveryNode node1 = newNode (1 , true );
301+ DiscoveryNode node2 = newNode (2 , true );
301302 long initialTerm = randomLongBetween (1 , 10 );
302303 long initialVersion = randomLongBetween (1 , 10 );
303304 setupFakeMasterServiceAndCoordinator (initialTerm , initialState (false , node0 , initialTerm , initialVersion ,
304- new VotingConfiguration (Collections .singleton (node1 .getId ()))));
305+ new VotingConfiguration (Collections .singleton (node2 .getId ()))));
305306 assertFalse (isLocalNodeElectedMaster ());
306307 long newTerm = initialTerm + randomLongBetween (1 , 10 );
307- SimpleFuture fut = joinNodeAsync (new JoinRequest (node0 , Optional .of (new Join (node0 , node0 , newTerm , initialTerm , initialVersion ))));
308+ SimpleFuture futNode0 = joinNodeAsync (new JoinRequest (node0 , Optional .of (
309+ new Join (node0 , node0 , newTerm , initialTerm , initialVersion ))));
308310 deterministicTaskQueue .runAllTasks (random ());
309- assertFalse (fut .isDone ());
311+ assertFalse (futNode0 .isDone ());
310312 assertFalse (isLocalNodeElectedMaster ());
311- joinNodeAndRun (new JoinRequest (node1 , Optional .of (new Join (node1 , node0 , newTerm , initialTerm , initialVersion ))));
313+ SimpleFuture futNode1 = joinNodeAsync (new JoinRequest (node1 , Optional .of (
314+ new Join (node1 , node0 , newTerm , initialTerm , initialVersion ))));
315+ deterministicTaskQueue .runAllTasks (random ());
316+ assertFalse (futNode1 .isDone ());
317+ assertFalse (isLocalNodeElectedMaster ());
318+ joinNodeAndRun (new JoinRequest (node2 , Optional .of (new Join (node2 , node0 , newTerm , initialTerm , initialVersion ))));
312319 assertTrue (isLocalNodeElectedMaster ());
313320 assertTrue (clusterStateHasNode (node1 ));
314- FutureUtils .get (fut );
321+ assertTrue (clusterStateHasNode (node2 ));
322+ FutureUtils .get (futNode0 );
323+ FutureUtils .get (futNode1 );
315324 }
316325
317326 public void testJoinFollowerWithHigherTerm () {
0 commit comments