From 1ce3f8dec9637a68fd0403e5f7a840628d5772b2 Mon Sep 17 00:00:00 2001 From: Sally MacFarlane Date: Thu, 2 May 2024 15:52:10 +1000 Subject: [PATCH] attempt to fix flaky test (#7008) Signed-off-by: Sally MacFarlane Co-authored-by: Simon Dudley --- ...ContractPermissioningOutOfSyncAcceptanceTest.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/NodeSmartContractPermissioningOutOfSyncAcceptanceTest.java b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/NodeSmartContractPermissioningOutOfSyncAcceptanceTest.java index 4315151473b..935db106ca5 100644 --- a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/NodeSmartContractPermissioningOutOfSyncAcceptanceTest.java +++ b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/NodeSmartContractPermissioningOutOfSyncAcceptanceTest.java @@ -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));