From 6ffb193e638fb365985b3930d6454c08219122b4 Mon Sep 17 00:00:00 2001 From: He-Pin Date: Sat, 28 Mar 2026 05:24:19 +0800 Subject: [PATCH] Remove non-deterministic SnapshotSerializeSpec test case MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove the 'test snapshot events with RetentionCriteria after sending commands' test that was never deterministic — it sent all commands at once and expected snapshots in a specific order, but internal async processing made the interleaving non-deterministic. Also add LogCapturing to CommonUtils trait for better test diagnostics. Upstream: akka/akka-core@50372b37c5 Cherry-picked from akka/akka-core v2.8.0, which is now Apache licensed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../scaladsl/CommonSnapshotTests.scala | 30 ------------------- 1 file changed, 30 deletions(-) diff --git a/persistence-testkit/src/test/scala/org/apache/pekko/persistence/testkit/scaladsl/CommonSnapshotTests.scala b/persistence-testkit/src/test/scala/org/apache/pekko/persistence/testkit/scaladsl/CommonSnapshotTests.scala index 4fc9a47d44a..a3e96a69d39 100644 --- a/persistence-testkit/src/test/scala/org/apache/pekko/persistence/testkit/scaladsl/CommonSnapshotTests.scala +++ b/persistence-testkit/src/test/scala/org/apache/pekko/persistence/testkit/scaladsl/CommonSnapshotTests.scala @@ -537,36 +537,6 @@ trait CommonSnapshotTests extends ScalaDslUtils { } - "test snapshot events with RetentionCriteria after sending commands" in { - - lazy val tk = new SnapshotTestKit(system) - - val pid = randomPid() - val act = system.spawn( - eventSourcedBehaviorWithState(pid).withRetention( - RetentionCriteria.snapshotEvery(numberOfEvents = 2, keepNSnapshots = 2)), - pid) - - act ! Cmd("a") - act ! Cmd("b") - act ! Cmd("c") - act ! Cmd("d") - act ! Cmd("e") - act ! Cmd("f") - act ! Cmd("g") - act ! Cmd("h") - act ! Cmd("i") - act ! Cmd("j") - act ! Cmd("k") - - tk.expectNextPersisted(pid, NonEmptyState("ab")) - tk.expectNextPersisted(pid, NonEmptyState("abcd")) - tk.expectNextPersisted(pid, NonEmptyState("abcdef")) - tk.expectNextPersisted(pid, NonEmptyState("abcdefgh")) - tk.expectNextPersisted(pid, NonEmptyState("abcdefghij")) - - } - specificTests() }