diff --git a/src/contrib/persistence/Akka.Persistence.Query.InMemory.Tests/InMemoryAllEventsSpec.cs b/src/contrib/persistence/Akka.Persistence.Query.InMemory.Tests/InMemoryAllEventsSpec.cs index 3067f87986b..5959c3475b6 100644 --- a/src/contrib/persistence/Akka.Persistence.Query.InMemory.Tests/InMemoryAllEventsSpec.cs +++ b/src/contrib/persistence/Akka.Persistence.Query.InMemory.Tests/InMemoryAllEventsSpec.cs @@ -18,6 +18,8 @@ private static Config Config() => ConfigurationFactory.ParseString("akka.logleve public InMemoryAllEventsSpec(ITestOutputHelper output) : base(Config(), nameof(InMemoryAllEventsSpec), output) { + // Proactively initialize the write journal to avoid cold-start delays on first persist + Persistence.Instance.Apply(Sys).JournalFor("akka.persistence.journal.inmem"); ReadJournal = Sys.ReadJournalFor(InMemoryReadJournal.Identifier); } } diff --git a/src/contrib/persistence/Akka.Persistence.Query.InMemory.Tests/InMemoryEventsByPersistenceIdSpec.cs b/src/contrib/persistence/Akka.Persistence.Query.InMemory.Tests/InMemoryEventsByPersistenceIdSpec.cs index d349915ae01..7b9824b1a5d 100644 --- a/src/contrib/persistence/Akka.Persistence.Query.InMemory.Tests/InMemoryEventsByPersistenceIdSpec.cs +++ b/src/contrib/persistence/Akka.Persistence.Query.InMemory.Tests/InMemoryEventsByPersistenceIdSpec.cs @@ -19,6 +19,8 @@ private static Config Config() => ConfigurationFactory.ParseString("akka.logleve public InMemoryEventsByPersistenceIdSpec(ITestOutputHelper output) : base(Config(), nameof(InMemoryCurrentPersistenceIdsSpec), output) { + // Proactively initialize the write journal to avoid cold-start delays on first persist + Persistence.Instance.Apply(Sys).JournalFor("akka.persistence.journal.inmem"); ReadJournal = Sys.ReadJournalFor(InMemoryReadJournal.Identifier); } } diff --git a/src/contrib/persistence/Akka.Persistence.Query.InMemory.Tests/InMemoryEventsByTagSpec.cs b/src/contrib/persistence/Akka.Persistence.Query.InMemory.Tests/InMemoryEventsByTagSpec.cs index b85629be893..9020ff74002 100644 --- a/src/contrib/persistence/Akka.Persistence.Query.InMemory.Tests/InMemoryEventsByTagSpec.cs +++ b/src/contrib/persistence/Akka.Persistence.Query.InMemory.Tests/InMemoryEventsByTagSpec.cs @@ -28,6 +28,8 @@ private static Config Config() => ConfigurationFactory.ParseString(@" public InMemoryEventsByTagSpec(ITestOutputHelper output) : base(Config(), nameof(InMemoryCurrentPersistenceIdsSpec), output) { + // Proactively initialize the write journal to avoid cold-start delays on first persist + Persistence.Instance.Apply(Sys).JournalFor("akka.persistence.journal.inmem"); ReadJournal = Sys.ReadJournalFor(InMemoryReadJournal.Identifier); }