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
This commit is contained in:
Christopher Batey 2018-01-16 15:06:42 +00:00 committed by GitHub
parent 2360de583d
commit accfa21731
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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]
}
}
}