-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TestProbe could break unit tests #105
Comments
Thanks for the report! We need to find a solution that doesn't depend on it, not sure how though ... |
What about some asynchronous TestProbe version (compiled for both Scala and Scala.js for tests portability)? ScalaTest 3 has support for asynchronous tests https://www.scalatest.org/release_notes/3.0.0 so one can write tests using Futures and no blocking at all. New Scala revisions have built-in support for async/await syntax scala/scala#8816 so writing portable tests (full of Futures) should be reasonably convenient. |
The problem here is that most tests are cross-compiled, so one would need to port to async tests the Akka codebase first, in order to benefit from them here, and, well, is going to be quite some work I believe |
Getting Akka team to make all the tests (i.e. in Akka test suite) non-blocking would be tough, indeed. Too bad Akka.js doesn't get much love from Akka team. However, I'm talking more about Akka.js users than Akka.js itself. Akka (or Akka.js) users don't depend on Akka test suite in their apps, instead they depend on Akka (or Akka.js) testkits and production (i.e. non test related) code of Akka. With async test probes (typed and untyped) one could completely avoid messing with JavaScript event loop and therefore rule out such interferences from debugging investigations. Is that correct? |
Yes, is entirely possible to write TestProbes in userland and get them working in async ScalaTest suites. |
Hi,
it seems that TestProbe can only be called 5 times. after that it breaks the test. I have a unit test like this:
Only test 1-5 could run. then it stops with this error:
I could put
val controller = TestProbe()
outsite scope of TestContext as a workaround, but some cases I have to redeclare it.Thanks.
The text was updated successfully, but these errors were encountered: