Skip to content

Commit

Permalink
Integration tests stability improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeykiselev committed Oct 13, 2017
1 parent d468fa3 commit ee9510a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
2 changes: 1 addition & 1 deletion src/it/scala/com/wavesplatform/it/MatcherTestSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down

0 comments on commit ee9510a

Please sign in to comment.