From 5539597ff8ec21a705ee523ce340ff8105162f2a Mon Sep 17 00:00:00 2001 From: Dominik Zajkowski Date: Fri, 9 Jul 2021 14:01:24 +0200 Subject: [PATCH] [Kaizen] Unflake RegularSynchSpec --- .../ethereum/blockchain/sync/regular/RegularSyncSpec.scala | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/test/scala/io/iohk/ethereum/blockchain/sync/regular/RegularSyncSpec.scala b/src/test/scala/io/iohk/ethereum/blockchain/sync/regular/RegularSyncSpec.scala index 31bd0e9483..bfba082ea7 100644 --- a/src/test/scala/io/iohk/ethereum/blockchain/sync/regular/RegularSyncSpec.scala +++ b/src/test/scala/io/iohk/ethereum/blockchain/sync/regular/RegularSyncSpec.scala @@ -87,6 +87,8 @@ class RegularSyncSpec def sync[T <: Fixture](test: => T): Future[Assertion] = Future { test + // this makes sure that actors are all done after the test (believe me, afterEach does not work with mocks) + TestKit.shutdownActorSystem(testSystem) succeed } @@ -475,7 +477,7 @@ class RegularSyncSpec peersClient.setAutoPilot(new PeersClientAutoPilot) override lazy val branchResolution: BranchResolution = stub[BranchResolution] (blockchainReader.getBestBlockNumber _).when().returns(0) - (branchResolution.resolveBranch _).when(*).returns(NewBetterBranch(Nil)).repeat(10) + (branchResolution.resolveBranch _).when(*).returns(NewBetterBranch(Nil)).atLeastOnce() (blockImport .importBlock(_: Block)(_: Scheduler)) .when(*, *)