From accfa21731d6a84e4acfd4606cfc582c419e1dc0 Mon Sep 17 00:00:00 2001 From: Christopher Batey Date: Tue, 16 Jan 2018 15:06:42 +0000 Subject: [PATCH] Fix race in OptionalSnapshotStoreSpec (#24323) Subscribe to log events before creating the actor otherwise it might miss the log message it is testing for Refs #24144 --- .../scala/akka/persistence/OptionalSnapshotStoreSpec.scala | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/akka-persistence/src/test/scala/akka/persistence/OptionalSnapshotStoreSpec.scala b/akka-persistence/src/test/scala/akka/persistence/OptionalSnapshotStoreSpec.scala index 439cb24843..bd5fe2fc85 100644 --- a/akka-persistence/src/test/scala/akka/persistence/OptionalSnapshotStoreSpec.scala +++ b/akka-persistence/src/test/scala/akka/persistence/OptionalSnapshotStoreSpec.scala @@ -47,8 +47,8 @@ class OptionalSnapshotStoreSpec extends PersistenceSpec(ConfigFactory.parseStrin "Persistence extension" must { "initialize properly even in absence of configured snapshot store" in { - system.actorOf(Props(classOf[AnyPersistentActor], name)) system.eventStream.subscribe(testActor, classOf[Logging.Warning]) + system.actorOf(Props(classOf[AnyPersistentActor], name)) val message = expectMsgType[Warning].message.toString message should include("No default snapshot store configured") } @@ -64,7 +64,6 @@ class OptionalSnapshotStoreSpec extends PersistenceSpec(ConfigFactory.parseStrin persistentActor ! "snap" expectMsgType[SaveSnapshotSuccess] } - } }