# Unit test always run the cluster and remoting service

**URL:** <https://discuss.akka.io/t/unit-test-always-run-the-cluster-and-remoting-service/4388>\
**Category:** Akka Cluster\
**Created:** [June 12, 2019, 9:03am UTC](https://discuss.akka.io/t/unit-test-always-run-the-cluster-and-remoting-service/4388 "2019-06-12T09:03:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mengxin](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.akka.io/mengxin/32/969_2.png) [@mengxin](https://discuss.akka.io/u/mengxin)\
**Post date:** [June 12, 2019, 9:03am UTC](https://discuss.akka.io/t/unit-test-always-run-the-cluster-and-remoting-service/4388/1 "2019-06-12T09:03:23Z")

</div>

When I run `sbt test` , the unit test always run the cluster:

```auto
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?

---

<div class="post-metadata">

**Author:** ![mengxin](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.akka.io/mengxin/32/969_2.png) [@mengxin](https://discuss.akka.io/u/mengxin)\
**Post date:** [June 12, 2019, 9:54am UTC](https://discuss.akka.io/t/unit-test-always-run-the-cluster-and-remoting-service/4388/2 "2019-06-12T09:54:47Z")

</div>

find the reason: need config `.configs(MultiJvm)`

---

<div class="post-metadata">

**Author:** ![bentito](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.akka.io/bentito/32/177_2.png) [@bentito](https://discuss.akka.io/u/bentito)\
**Post date:** [June 12, 2019, 5:15pm UTC](https://discuss.akka.io/t/unit-test-always-run-the-cluster-and-remoting-service/4388/3 "2019-06-12T17:15:55Z")

</div>

So if you turn on MultiJvm you will be able run without remoting and cluster options from the config at unit test time? Or is this just a workaround?
