Skip to content

Commit 712bb0a

Browse files
committed
[Kaizen] Unflake PeerDiscoveryManagerSpec
1 parent da11b98 commit 712bb0a

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,11 @@ import org.scalatest.matchers.should.Matchers
3333
import scodec.bits.BitVector
3434

3535
import io.iohk.ethereum.NormalPatience
36-
import io.iohk.ethereum.WithActorSystemShutDown
3736
import io.iohk.ethereum.db.storage.KnownNodesStorage
3837
import io.iohk.ethereum.utils.Config
3938

4039
class 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

Comments
 (0)