From 9c7abe4e27dd6031137d9667bf424d7e83401e26 Mon Sep 17 00:00:00 2001 From: JingZhang Chen Date: Thu, 2 Nov 2023 09:21:55 +0800 Subject: [PATCH] fix: replace future --- .../jdbc/query/CurrentEventsByTagTest.scala | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/core/src/test/scala/akka/persistence/jdbc/query/CurrentEventsByTagTest.scala b/core/src/test/scala/akka/persistence/jdbc/query/CurrentEventsByTagTest.scala index dc11862b..5df7eeed 100644 --- a/core/src/test/scala/akka/persistence/jdbc/query/CurrentEventsByTagTest.scala +++ b/core/src/test/scala/akka/persistence/jdbc/query/CurrentEventsByTagTest.scala @@ -179,9 +179,13 @@ abstract class CurrentEventsByTagTest(config: String) extends QueryTestSpec(conf withTestActors(replyToMessages = true) { (actor1, actor2, actor3) => def sendMessagesWithTag(tag: String, numberOfMessagesPerActor: Int): Future[Done] = { val futures = for (actor <- Seq(actor1, actor2, actor3); i <- 1 to numberOfMessagesPerActor) yield { - Future { - // block the remaining small batch events from being fired - if (i == diff) latch.await() + // block the remaining small batch events from being fired + if (i == diff) { + Future { + latch.await() + actor ? TaggedAsyncEvent(Event(i.toString), tag) + } + } else { actor ? TaggedAsyncEvent(Event(i.toString), tag) } }