Merge pull request #4784 from eatkins/fix-scala-instance-test

Wait for akka termination in test
This commit is contained in:
eugene yokota 2019-06-08 19:52:30 +02:00 committed by GitHub
commit 299bdcd372
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -1,6 +1,8 @@
package akka.actor
import org.junit._
import scala.concurrent._
import scala.concurrent.duration._
class BadTest {
@ -13,7 +15,7 @@ class BadTest {
val system = ActorSystem()
def evilGetThreadExectionContextName =
system.asInstanceOf[ActorSystemImpl].internalCallingThreadExecutionContext.getClass.getName
system.terminate()
Await.result(system.terminate(), 5.seconds)
val expected = "scala.concurrent.Future$InternalCallbackExecutor$"
Assert.assertEquals("Failed to grab appropriate Akka name", expected, evilGetThreadExectionContextName)
}