Skip to content

Commit 0c1ae35

Browse files
author
Zhen Li
committed
Fixing failing 3.4 build
1 parent 0373106 commit 0c1ae35

File tree

4 files changed

+8
-1
lines changed

4 files changed

+8
-1
lines changed
File renamed without changes.
File renamed without changes.
File renamed without changes.

driver/src/test/java/org/neo4j/driver/v1/integration/CausalClusteringIT.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -918,6 +918,7 @@ private void awaitLeaderToStepDown( Driver driver )
918918
int leadersCount;
919919
int followersCount;
920920
int readReplicasCount;
921+
boolean isLeaderDown;
921922
do
922923
{
923924
try ( Session session = driver.session() )
@@ -948,9 +949,15 @@ else if ( role == ClusterMemberRole.READ_REPLICA )
948949
leadersCount = newLeadersCount;
949950
followersCount = newFollowersCount;
950951
readReplicasCount = newReadReplicasCount;
952+
isLeaderDown = leadersCount == 0 && followersCount == 1 && readReplicasCount <= 3;
953+
}
954+
catch( SessionExpiredException e )
955+
{
956+
// we failed to get a valid routing table due to leader down
957+
isLeaderDown = true;
951958
}
952959
}
953-
while ( !(leadersCount == 0 && followersCount == 1 && readReplicasCount == 2) );
960+
while ( !isLeaderDown );
954961
}
955962

956963
private Driver createDriver( URI boltUri )

0 commit comments

Comments
 (0)