@@ -33,14 +33,11 @@ import org.scalatest.matchers.should.Matchers
3333import scodec .bits .BitVector
3434
3535import io .iohk .ethereum .NormalPatience
36- import io .iohk .ethereum .WithActorSystemShutDown
3736import io .iohk .ethereum .db .storage .KnownNodesStorage
3837import io .iohk .ethereum .utils .Config
3938
4039class PeerDiscoveryManagerSpec
41- extends TestKit (ActorSystem (" PeerDiscoveryManagerSpec_System" ))
42- with AnyFlatSpecLike
43- with WithActorSystemShutDown
40+ extends AnyFlatSpecLike
4441 with Matchers
4542 with Eventually
4643 with MockFactory
@@ -64,6 +61,7 @@ class PeerDiscoveryManagerSpec
6461 ).map(new java.net.URI (_)).map(Node .fromUri)
6562
6663 trait Fixture {
64+ implicit lazy val system : ActorSystem = ActorSystem (" PeerDiscoveryManagerSpec_System" )
6765 lazy val discoveryConfig = defaultConfig
6866 lazy val knownNodesStorage : KnownNodesStorage = mock[KnownNodesStorage ]
6967 lazy val discoveryService : DiscoveryService = mock[DiscoveryService ]
@@ -93,7 +91,10 @@ class PeerDiscoveryManagerSpec
9391
9492 def test (fixture : Fixture ): Unit =
9593 try fixture.test()
96- finally system.stop(fixture.peerDiscoveryManager)
94+ finally {
95+ fixture.system.stop(fixture.peerDiscoveryManager)
96+ TestKit .shutdownActorSystem(fixture.system, verifySystemShutdown = true )
97+ }
9798
9899 def toENode (node : Node ): ENode =
99100 ENode (
0 commit comments