From 6fcac7bd45c52ac0b03f6caa1fe3ca6bd796913d Mon Sep 17 00:00:00 2001 From: Sally MacFarlane Date: Fri, 22 Mar 2024 11:50:52 +1000 Subject: [PATCH] extra check for syncing (#6771) Signed-off-by: Sally MacFarlane --- ...SmartContractPermissioningV2AcceptanceTest.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/NodeSmartContractPermissioningV2AcceptanceTest.java b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/NodeSmartContractPermissioningV2AcceptanceTest.java index b04bad5644..e638614ad5 100644 --- a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/NodeSmartContractPermissioningV2AcceptanceTest.java +++ b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/NodeSmartContractPermissioningV2AcceptanceTest.java @@ -47,10 +47,7 @@ public class NodeSmartContractPermissioningV2AcceptanceTest permissionedNode.execute(allowNode(permissionedNode)); permissionedNode.verify(connectionIsAllowed(permissionedNode)); - allowedNode.verify(eth.syncingStatus(false)); - bootnode.verify(eth.syncingStatus(false)); - permissionedNode.verify(eth.syncingStatus(false)); - forbiddenNode.verify(eth.syncingStatus(false)); + verifyAllNodesHaveFinishedSyncing(); } @Test @@ -92,6 +89,8 @@ public class NodeSmartContractPermissioningV2AcceptanceTest permissionedNode.verify(admin.addPeer(allowedNode)); permissionedNode.verify(net.awaitPeerCount(2)); + verifyAllNodesHaveFinishedSyncing(); + // permissioning changes in peer should propagate to permissioned node allowedNode.execute(allowNode(forbiddenNode)); allowedNode.verify(connectionIsAllowed(forbiddenNode)); @@ -101,6 +100,13 @@ public class NodeSmartContractPermissioningV2AcceptanceTest permissionedNode.verify(net.awaitPeerCount(3)); } + private void verifyAllNodesHaveFinishedSyncing() { + allowedNode.verify(eth.syncingStatus(false)); + bootnode.verify(eth.syncingStatus(false)); + permissionedNode.verify(eth.syncingStatus(false)); + forbiddenNode.verify(eth.syncingStatus(false)); + } + @Test public void onchainPermissioningAllowlistShouldPersistAcrossRestarts() { permissionedCluster.stop();