Skip to content

Commit

Permalink
[ETCM-283] Add Thread.sleep in order to fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
mirkoAlic committed Nov 24, 2020
1 parent b7ca4b6 commit 5f0e5c2
Showing 1 changed file with 4 additions and 1 deletion.
Expand Up @@ -5,7 +5,7 @@ import akka.actor.ActorSystem
import akka.testkit.{TestKit, TestProbe}
import com.miguno.akka.testing.VirtualTime
import io.iohk.ethereum.Mocks.{MockValidatorsAlwaysSucceed, MockValidatorsFailingOnBlockBodies}
import io.iohk.ethereum.BlockHelpers
import io.iohk.ethereum.{BlockHelpers, Timeouts}
import io.iohk.ethereum.Fixtures.{Blocks => FixtureBlocks}
import io.iohk.ethereum.blockchain.sync.PeersClient.BlacklistPeer
import io.iohk.ethereum.blockchain.sync.regular.BlockFetcher.{InternalLastBlockImport, InvalidateBlocksFrom, PickBlocks}
Expand Down Expand Up @@ -189,6 +189,9 @@ class BlockFetcherSpec extends TestKit(ActorSystem("BlockFetcherSpec_System")) w
val getBlockBodiesResponse2 = BlockBodies(subChain2.map(_.body))
peersClient.reply(PeersClient.Response(fakePeer, getBlockBodiesResponse2))

// We need to wait a while in order to allow fetcher to process all the blocks
Thread.sleep(Timeouts.shortTimeout.toMillis)

// Fetcher should enqueue all the received blocks
importer.send(blockFetcher, PickBlocks(chain.size))
importer.ignoreMsg({ case BlockImporter.NotOnTop => true })
Expand Down

0 comments on commit 5f0e5c2

Please sign in to comment.