diff --git a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/clique/CliqueMiningAcceptanceTest.java b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/clique/CliqueMiningAcceptanceTest.java index 50c58f8b34b..f6718b4ded1 100644 --- a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/clique/CliqueMiningAcceptanceTest.java +++ b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/clique/CliqueMiningAcceptanceTest.java @@ -86,7 +86,7 @@ public void shouldMineTransactionsOnMultipleNodes() throws IOException { final BesuNode minerNode1 = besu.createCliqueNode("miner1"); final BesuNode minerNode2 = besu.createCliqueNode("miner2"); final BesuNode minerNode3 = besu.createCliqueNode("miner3"); - cluster.start(minerNode1, minerNode2, minerNode3); + startClusterAndVerifyProducingBlocks(minerNode1, minerNode2, minerNode3); final Account sender = accounts.createAccount("account1"); final Account receiver = accounts.createAccount("account2"); @@ -106,7 +106,7 @@ public void shouldStallMiningWhenInsufficientValidators() throws IOException { final BesuNode minerNode1 = besu.createCliqueNode("miner1"); final BesuNode minerNode2 = besu.createCliqueNode("miner2"); final BesuNode minerNode3 = besu.createCliqueNode("miner3"); - cluster.start(minerNode1, minerNode2, minerNode3); + startClusterAndVerifyProducingBlocks(minerNode1, minerNode2, minerNode3); cluster.stopNode(minerNode2); cluster.stopNode(minerNode3); @@ -116,12 +116,23 @@ public void shouldStallMiningWhenInsufficientValidators() throws IOException { minerNode1.verify(clique.noNewBlockCreated(minerNode1)); } + private void startClusterAndVerifyProducingBlocks( + final BesuNode minerNode1, final BesuNode minerNode2, final BesuNode minerNode3) { + cluster.start(minerNode1, minerNode2, minerNode3); + + // verify that we have started producing blocks + waitForBlockHeight(minerNode1, 1); + final var minerChainHead = minerNode1.execute(ethTransactions.block()); + minerNode2.verify(blockchain.minimumHeight(minerChainHead.getNumber().longValue())); + minerNode3.verify(blockchain.minimumHeight(minerChainHead.getNumber().longValue())); + } + @Test public void shouldStillMineWhenANodeFailsAndHasSufficientValidators() throws IOException { final BesuNode minerNode1 = besu.createCliqueNode("miner1"); final BesuNode minerNode2 = besu.createCliqueNode("miner2"); final BesuNode minerNode3 = besu.createCliqueNode("miner3"); - cluster.start(minerNode1, minerNode2, minerNode3); + startClusterAndVerifyProducingBlocks(minerNode1, minerNode2, minerNode3); cluster.verifyOnActiveNodes(blockchain.reachesHeight(minerNode1, 1, 85));