From 3425b1ae7f88952f15a4bbc40ae0a18a4e1530ab Mon Sep 17 00:00:00 2001 From: Jason Frame Date: Fri, 7 Dec 2018 12:07:37 +1000 Subject: [PATCH] [NC-1524] Update clique getSigners acceptance test start with single node to improve reliability --- .../clique/CliqueGetSignersRpcTest.java | 40 ++++++------------- .../src/test/resources/clique/clique.json | 2 +- 2 files changed, 14 insertions(+), 28 deletions(-) diff --git a/acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/clique/CliqueGetSignersRpcTest.java b/acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/clique/CliqueGetSignersRpcTest.java index 0a9ffd2c12..fd21a1d2f7 100644 --- a/acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/clique/CliqueGetSignersRpcTest.java +++ b/acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/clique/CliqueGetSignersRpcTest.java @@ -18,53 +18,39 @@ import tech.pegasys.pantheon.tests.acceptance.dsl.AcceptanceTestBase; import tech.pegasys.pantheon.tests.acceptance.dsl.node.PantheonNode; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; -@Ignore public class CliqueGetSignersRpcTest extends AcceptanceTestBase { private PantheonNode minerNode1; private PantheonNode minerNode2; - private PantheonNode minerNode3; - private PantheonNode[] allNodes; - private PantheonNode[] initialNodes; @Before public void setUp() throws Exception { - final String[] validators = {"miner1", "miner2"}; + final String[] validators = {"miner1"}; minerNode1 = pantheon.createCliqueNodeWithValidators("miner1", validators); minerNode2 = pantheon.createCliqueNodeWithValidators("miner2", validators); - minerNode3 = pantheon.createCliqueNodeWithValidators("miner3", validators); - initialNodes = new PantheonNode[] {minerNode1, minerNode2}; - allNodes = new PantheonNode[] {minerNode1, minerNode2, minerNode3}; - cluster.start(allNodes); + cluster.start(minerNode1, minerNode2); } @Test public void shouldBeAbleToGetValidatorsForBlockNumber() { - cluster.verify(clique.validatorsAtBlockEqual("0x0", initialNodes)); - cluster.waitUntil(wait.chainHeadIsAt(1)); - minerNode1.execute(cliqueTransactions.createAddProposal(minerNode3)); - minerNode2.execute(cliqueTransactions.createAddProposal(minerNode3)); + cluster.verify(clique.validatorsAtBlockEqual("0x0", minerNode1)); + minerNode1.waitUntil(wait.chainHeadIsAt(1)); + minerNode1.execute(cliqueTransactions.createAddProposal(minerNode2)); cluster.waitUntil(wait.chainHeadHasProgressed(minerNode1, 1)); - cluster.verify(clique.validatorsAtBlockEqual("0x2", initialNodes)); - - minerNode1.waitUntil(wait.chainHeadHasProgressed(minerNode1, 1)); - cluster.verify(clique.validatorsAtBlockEqual("0x3", allNodes)); - cluster.verify(clique.validatorsAtBlockEqual(LATEST, allNodes)); + cluster.verify(clique.validatorsAtBlockEqual("0x2", minerNode1, minerNode2)); + cluster.verify(clique.validatorsAtBlockEqual(LATEST, minerNode1, minerNode2)); } @Test public void shouldBeAbleToGetValidatorsForBlockHash() { - cluster.verify(clique.validatorsAtBlockHashFromBlockNumberEqual(minerNode1, 0, initialNodes)); - minerNode1.execute(cliqueTransactions.createAddProposal(minerNode3)); - minerNode2.execute(cliqueTransactions.createAddProposal(minerNode3)); - - minerNode1.waitUntil(wait.chainHeadHasProgressed(minerNode1, 1)); - cluster.verify(clique.validatorsAtBlockHashFromBlockNumberEqual(minerNode1, 1, initialNodes)); + cluster.verify(clique.validatorsAtBlockHashFromBlockNumberEqual(minerNode1, 0, minerNode1)); + minerNode1.waitUntil(wait.chainHeadIsAt(1)); - minerNode1.waitUntil(wait.chainHeadHasProgressed(minerNode1, 1)); - cluster.verify(clique.validatorsAtBlockHashFromBlockNumberEqual(minerNode1, 3, allNodes)); + minerNode1.execute(cliqueTransactions.createAddProposal(minerNode2)); + cluster.waitUntil(wait.chainHeadHasProgressed(minerNode1, 1)); + cluster.verify( + clique.validatorsAtBlockHashFromBlockNumberEqual(minerNode1, 2, minerNode1, minerNode2)); } } diff --git a/acceptance-tests/src/test/resources/clique/clique.json b/acceptance-tests/src/test/resources/clique/clique.json index 6404b77da9..9f1d22eba3 100644 --- a/acceptance-tests/src/test/resources/clique/clique.json +++ b/acceptance-tests/src/test/resources/clique/clique.json @@ -8,7 +8,7 @@ "eip158Block": 0, "byzantiumBlock": 0, "clique": { - "blockperiodseconds": 5, + "blockperiodseconds": 10, "epochlength": 30000 } },