Skip to content

Commit

Permalink
attempt to fix flaky test (hyperledger#7008)
Browse files Browse the repository at this point in the history
Signed-off-by: Sally MacFarlane <[email protected]>
Co-authored-by: Simon Dudley <[email protected]>
  • Loading branch information
macfarla and siladu authored May 2, 2024
1 parent afea4e0 commit 1ce3f8d
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,18 @@ public void addNodeToClusterAndVerifyNonBootNodePeerConnectionWorksAfterSync() {
final long blockchainHeight = 25L;
waitForBlockHeight(permissionedNodeA, blockchainHeight);

// Add Node B
// verify Node A is in sync with bootnode
final var minerChainHead = bootnode.execute(ethTransactions.block());
permissionedNodeA.verify(blockchain.minimumHeight(minerChainHead.getNumber().longValue()));

// check that connection is forbidden (before node b is permitted)
permissionedCluster.addNode(permissionedNodeB);
permissionedNodeB.verify(connectionIsForbidden(permissionedNodeA, permissionedNodeB));

// Permit Node B
permissionedNodeA.execute(allowNode(permissionedNodeB));
permissionedNodeA.verify(admin.addPeer(permissionedNodeB));

// check that connection is forbidden (while node b is syncing)
permissionedNodeB.verify(connectionIsForbidden(permissionedNodeA, permissionedNodeB));

// connection should be allowed after node B syncs
waitForBlockHeight(permissionedNodeB, blockchainHeight);
permissionedNodeB.verify(connectionIsAllowed(permissionedNodeA, permissionedNodeB));
Expand Down

0 comments on commit 1ce3f8d

Please sign in to comment.