From ee9510a6532fea901b8e5ee0cc4567709d78eef8 Mon Sep 17 00:00:00 2001 From: Alexey Kiselev Date: Fri, 13 Oct 2017 17:15:39 +0300 Subject: [PATCH] Integration tests stability improvements --- .../it/IntegrationSuiteWithThreeAddresses.scala | 4 ++-- .../com/wavesplatform/it/MatcherTestSuite.scala | 2 +- .../it/NetworkSeparationTestSuite.scala | 15 +++++++-------- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/it/scala/com/wavesplatform/it/IntegrationSuiteWithThreeAddresses.scala b/src/it/scala/com/wavesplatform/it/IntegrationSuiteWithThreeAddresses.scala index 9bb7f97745..8eec65fae7 100644 --- a/src/it/scala/com/wavesplatform/it/IntegrationSuiteWithThreeAddresses.scala +++ b/src/it/scala/com/wavesplatform/it/IntegrationSuiteWithThreeAddresses.scala @@ -95,13 +95,13 @@ trait IntegrationSuiteWithThreeAddresses extends FunSuite with BeforeAndAfterAll txs <- makeTransfers height <- traverse(allNodes)(_.height).map(_.max) - _ <- traverse(allNodes)(_.waitForHeight(height + 1)) + _ <- traverse(allNodes)(_.waitForHeight(height + 2)) _ <- waitForTxsToReachAllNodes(txs) _ <- Future.sequence(Seq(firstAddress, secondAddress, thirdAddress).map(address => assertBalances(address, defaultBalance, defaultBalance))) } yield succeed - Await.result(correctStartBalancesFuture, 2.minutes) + Await.result(correctStartBalancesFuture, 5.minutes) } } diff --git a/src/it/scala/com/wavesplatform/it/MatcherTestSuite.scala b/src/it/scala/com/wavesplatform/it/MatcherTestSuite.scala index 6f6fa0c285..c6bb0a0732 100644 --- a/src/it/scala/com/wavesplatform/it/MatcherTestSuite.scala +++ b/src/it/scala/com/wavesplatform/it/MatcherTestSuite.scala @@ -273,7 +273,7 @@ class MatcherTestSuite extends FreeSpec with Matchers with BeforeAndAfterAll { private def getBalance(node: Node): (Long, Long) = { val initialHeight = Await.result(node.height, 1.minute) - Await.result(node.waitForHeight(initialHeight + 1), 1.minute) + Await.result(node.waitForHeight(initialHeight + 2), 2.minute) val balance = Await.result(node.balance(node.address), 1.minute).balance val height = Await.result(node.height, 1.minute) diff --git a/src/it/scala/com/wavesplatform/it/NetworkSeparationTestSuite.scala b/src/it/scala/com/wavesplatform/it/NetworkSeparationTestSuite.scala index b000a9a1d8..01f582bdc4 100644 --- a/src/it/scala/com/wavesplatform/it/NetworkSeparationTestSuite.scala +++ b/src/it/scala/com/wavesplatform/it/NetworkSeparationTestSuite.scala @@ -21,17 +21,16 @@ class NetworkSeparationTestSuite extends FreeSpec with Matchers with BeforeAndAf private def validateBlocks(nodes: Seq[Node]): Unit = { val targetBlocks1 = result(for { height <- traverse(nodes)(_.height).map(_.max) - _ <- traverse(nodes)(_.waitForHeight(height + 20)) - _ <- traverse(nodes)(_.waitForHeight(height + 15)) - blocks <- traverse(nodes)(_.blockAt(height + 15)) + _ <- traverse(nodes)(_.waitForHeight(height + 10)) + blocks <- traverse(nodes)(_.blockAt(height + 8)) } yield blocks.map(_.signature), 5.minutes) all(targetBlocks1) shouldEqual targetBlocks1.head } - "node should grow up to 30 blocks together" in { + "node should grow up to 10 blocks together" in { val richestNode = nodes.maxBy(n => Await.result(n.balance(n.address), 1.minute).balance) - Await.result(richestNode.waitForHeight(30), 5.minutes) - Await.result(richestNode.height, 1.minute) >= 30 shouldBe true + Await.result(richestNode.waitForHeight(10), 5.minutes) + Await.result(richestNode.height, 1.minute) >= 10 shouldBe true } "then we disconnect nodes from the network" in { @@ -40,8 +39,8 @@ class NetworkSeparationTestSuite extends FreeSpec with Matchers with BeforeAndAf "and wait for another 10 blocks on one node" in { val richestNode = nodes.maxBy(n => Await.result(n.balance(n.address), 1.minute).balance) - Await.result(richestNode.waitForHeight(40), 5.minutes) - Await.result(richestNode.height, 1.minute) >= 40 shouldBe true + Await.result(richestNode.waitForHeight(20), 5.minutes) + Await.result(richestNode.height, 1.minute) >= 20 shouldBe true } "after that we connect nodes back to the network" in {