When I run sbt test
, the unit test always run the cluster:
akka.event.slf4j.Slf4jLogger - Slf4jLogger started
15:31:31.589 [channel-ChannelRoutesSpec-akka.actor.default-dispatcher-2] [xin-deepnet] INFO akka.remote.Remoting - Starting remoting
15:31:31.719 [channel-ChannelRoutesSpec-akka.actor.default-dispatcher-4] [xin-deepnet] INFO akka.remote.Remoting - Remoting started; listening on addresses :[akka.tcp://dcs-channel-ChannelRoutesSpec@0.0.0.0:1600]
Then the test will fail by the Port already used, is there any method to prevent the remoting and cluster in the unit tests? or Just need to make the cluster port random when doing the unit test?