Skip to content

Commit 22500a7

Browse files
committed
Merge branch 'develop' into feature/etcm_269_healthcheck_bugfix
2 parents 8aef538 + c515e36 commit 22500a7

File tree

5 files changed

+31
-16
lines changed

5 files changed

+31
-16
lines changed

src/test/scala/io/iohk/ethereum/blockchain/sync/regular/BlockFetcherSpec.scala

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import akka.actor.ActorSystem
66
import akka.testkit.{TestKit, TestProbe}
77
import com.miguno.akka.testing.VirtualTime
88
import io.iohk.ethereum.Mocks.{MockValidatorsAlwaysSucceed, MockValidatorsFailingOnBlockBodies}
9-
import io.iohk.ethereum.{BlockHelpers, Timeouts}
9+
import io.iohk.ethereum.{BlockHelpers, Timeouts, WithActorSystemShutDown}
1010
import io.iohk.ethereum.Fixtures.{Blocks => FixtureBlocks}
1111
import io.iohk.ethereum.blockchain.sync.PeersClient.BlacklistPeer
1212
import io.iohk.ethereum.blockchain.sync.regular.BlockFetcher.{InternalLastBlockImport, InvalidateBlocksFrom, PickBlocks}
@@ -24,7 +24,11 @@ import org.scalatest.matchers.should.Matchers
2424

2525
import scala.concurrent.duration._
2626

27-
class BlockFetcherSpec extends TestKit(ActorSystem("BlockFetcherSpec_System")) with AnyFreeSpecLike with Matchers {
27+
class BlockFetcherSpec
28+
extends TestKit(ActorSystem("BlockFetcherSpec_System"))
29+
with AnyFreeSpecLike
30+
with WithActorSystemShutDown
31+
with Matchers {
2832

2933
"BlockFetcher" - {
3034

src/test/scala/io/iohk/ethereum/blockchain/sync/regular/BlockFetcherStateSpec.scala

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,18 @@ package io.iohk.ethereum.blockchain.sync.regular
33
import akka.actor.ActorSystem
44
import akka.testkit.{TestKit, TestProbe}
55
import io.iohk.ethereum.Mocks.MockValidatorsAlwaysSucceed
6-
import io.iohk.ethereum.BlockHelpers
6+
import io.iohk.ethereum.{BlockHelpers, WithActorSystemShutDown}
77
import io.iohk.ethereum.network.PeerId
88
import org.scalatest.matchers.should.Matchers
99
import org.scalatest.wordspec.AnyWordSpecLike
1010

1111
import scala.collection.immutable.Queue
1212

13-
class BlockFetcherStateSpec extends TestKit(ActorSystem()) with AnyWordSpecLike with Matchers {
13+
class BlockFetcherStateSpec
14+
extends TestKit(ActorSystem("BlockFetcherStateSpec_System"))
15+
with AnyWordSpecLike
16+
with WithActorSystemShutDown
17+
with Matchers {
1418

1519
lazy val validators = new MockValidatorsAlwaysSucceed
1620

src/test/scala/io/iohk/ethereum/consensus/ethash/EthashMinerSpec.scala

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package ethash
33

44
import akka.actor.{ActorRef, ActorSystem}
55
import akka.testkit.{TestActor, TestActorRef, TestKit, TestProbe}
6-
import io.iohk.ethereum.Fixtures
6+
import io.iohk.ethereum.{Fixtures, WithActorSystemShutDown}
77
import io.iohk.ethereum.consensus.blocks.{PendingBlock, PendingBlockAndState}
88
import io.iohk.ethereum.consensus.ethash.validators.EthashBlockHeaderValidator
99
import io.iohk.ethereum.consensus.validators.BlockHeaderValid
@@ -16,11 +16,17 @@ import monix.eval.Task
1616
import org.bouncycastle.util.encoders.Hex
1717
import org.scalamock.scalatest.MockFactory
1818
import org.scalatest.Tag
19+
1920
import scala.concurrent.duration._
2021
import org.scalatest.flatspec.AnyFlatSpecLike
2122
import org.scalatest.matchers.should.Matchers
2223

23-
class EthashMinerSpec extends TestKit(ActorSystem("EthashMinerSpec_System")) with AnyFlatSpecLike with Matchers {
24+
class EthashMinerSpec
25+
extends TestKit(ActorSystem("EthashMinerSpec_System"))
26+
with AnyFlatSpecLike
27+
with WithActorSystemShutDown
28+
with Matchers {
29+
2430
final val EthashMinerSpecTag = Tag("EthashMinerSpec")
2531

2632
private implicit val timeout: Duration = 10.minutes

src/test/scala/io/iohk/ethereum/network/PeerManagerSpec.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import io.iohk.ethereum.network.p2p.messages.CommonMessages.NewBlock
1818
import io.iohk.ethereum.network.p2p.messages.ProtocolVersions
1919
import io.iohk.ethereum.network.p2p.messages.WireProtocol.Disconnect
2020
import io.iohk.ethereum.utils.Config
21-
import io.iohk.ethereum.{Fixtures, NormalPatience}
21+
import io.iohk.ethereum.{Fixtures, NormalPatience, WithActorSystemShutDown}
2222
import org.bouncycastle.util.encoders.Hex
2323
import org.scalatest.concurrent.Eventually
2424
import org.scalatest.flatspec.AnyFlatSpecLike
@@ -28,6 +28,7 @@ import org.scalatest.matchers.should.Matchers
2828
class PeerManagerSpec
2929
extends TestKit(ActorSystem("PeerManagerSpec_System"))
3030
with AnyFlatSpecLike
31+
with WithActorSystemShutDown
3132
with Matchers
3233
with Eventually
3334
with NormalPatience {

src/test/scala/io/iohk/ethereum/network/discovery/PeerDiscoveryManagerSpec.scala

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
11
package io.iohk.ethereum.network.discovery
22

3-
import akka.pattern.ask
43
import akka.actor.ActorSystem
4+
import akka.pattern.{AskTimeoutException, ask}
55
import akka.testkit.{TestActorRef, TestKit}
66
import akka.util.{ByteString, Timeout}
77
import cats.effect.Resource
8-
import io.iohk.ethereum.NormalPatience
9-
import io.iohk.ethereum.utils.Config
108
import io.iohk.ethereum.db.storage.KnownNodesStorage
9+
import io.iohk.ethereum.utils.Config
10+
import io.iohk.ethereum.{NormalPatience, WithActorSystemShutDown}
1111
import io.iohk.scalanet.discovery.crypto.PublicKey
1212
import io.iohk.scalanet.discovery.ethereum.v4.DiscoveryService
1313
import io.iohk.scalanet.discovery.ethereum.{Node => ENode}
1414
import monix.eval.Task
1515
import monix.execution.Scheduler
1616
import monix.execution.atomic.AtomicInt
17-
import org.scalatest.concurrent.Eventually
17+
import org.scalamock.scalatest.MockFactory
18+
import org.scalatest.concurrent.{Eventually, ScalaFutures}
1819
import org.scalatest.flatspec.AnyFlatSpecLike
1920
import org.scalatest.matchers.should.Matchers
20-
import org.scalatest.concurrent.ScalaFutures
21-
import org.scalamock.scalatest.MockFactory
22-
import scala.concurrent.duration._
2321
import scodec.bits.BitVector
24-
import scala.util.control.NoStackTrace
22+
2523
import scala.collection.immutable.SortedSet
26-
import akka.pattern.AskTimeoutException
24+
import scala.concurrent.duration._
25+
import scala.util.control.NoStackTrace
2726

2827
class PeerDiscoveryManagerSpec
2928
extends TestKit(ActorSystem("PeerDiscoveryManagerSpec_System"))
3029
with AnyFlatSpecLike
30+
with WithActorSystemShutDown
3131
with Matchers
3232
with Eventually
3333
with MockFactory

0 commit comments

Comments
 (0)