I put this line in my application.conf testing project
akka.remote.netty.tcp.port = 0
Each actor system will bind a diffrent port and will run in parallel.

Em sexta-feira, 13 de novembro de 2015 10:58:49 UTC-3, Ian Phillips 
escreveu:
>
> I'm after some advice as to best practice when setting up multiple 
> (ScalaTest) tests in an Akka project, I'm using a base class like so:
>
> class BaseSpec extends TestKit(ActorSystem("application"))
>   with FlatSpecLike with Matchers with ScalaFutures with ImplicitSender 
> with BeforeAndAfterAll {
>
>   implicit lazy val config = ConfigFactory.load()
>   implicit lazy val moreAppSpecificStuff = ???
>
>   override protected def afterAll() {
>     Await.result(system.terminate(), 10 seconds)
>     info(s"${getClass.getSimpleName} actor system terminated")
>     super.afterAll()
>   }
>
> }
>
>
> If I use this to run tests individually (i.e. test-only) then everything 
> is fine, but if I try to run multiple tests (i.e. test) then I get about 
> half of my tests failing with “*Failed to bind to: /127.0.0.1:2551 
> <http://127.0.0.1:2551>*”, so obviously the actor system for one test is 
> not shutting down and releasing the port before the next test tries to 
> start up it's actor system.
>
> My build.sbt file has the following line, which I thought should force 
> the tests to be sequential:
>
> parallelExecution in Test := false
>
> How do people normally handle this scenario?
>
>

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to