apache / apache/pekko-persistence-cassandra

EventsByTagPersistenceIdCleanupSpec: PersistenceId cleanup must drop state and trigger new persistence id lookup periodically

Open
#280 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Scala
Stars
15
Forks
17
Avg merge
6h 43m
Merged PRs (30d)
11

Description

```
<-- [PersistenceId cleanup must drop state and trigger new persistence id lookup periodically] End of log messages of test that [Failed(org.scalatest.exceptions.TestFailedDueToTimeoutException: The code passed to eventually never returned normally. Attempted 11 times over 21.881975574 seconds. Last failure message: assertion failed: received unexpected message RealMessage(OnNext(EventEnvelope(TimeBasedUUID(2147f8c0-1923-11f0-9b7c-855961ac02d3),cleanup,2,cleanup-2,1744629912140,None)),Actor[pekko://AbstractEventsByTagSpec/deadLetters]) after 100 millis.)]
[info] - must drop state and trigger new persistence id lookup periodically *** FAILED *** (21 seconds, 929 milliseconds)
[info] The code passed to eventually never returned normally. Attempted 11 times over 21.881975574 seconds. Last failure message: assertion failed: received unexpected message RealMessage(OnNext(EventEnvelope(TimeBasedUUID(2147f8c0-1923-11f0-9b7c-855961ac02d3),cleanup,2,cleanup-2,1744629912140,None)),Actor[pekko://AbstractEventsByTagSpec/deadLetters]) after 100 millis. (EventsByTagSpec.scala:1374)
[info] org.scalatest.exceptions.TestFailedDueToTimeoutException:
[info] at org.scalatest.enablers.Retrying$$anon$4.tryTryAgain$2(Retrying.scala:219)
[info] at org.scalatest.enablers.Retrying$$anon$4.retry(Retrying.scala:226)
[info] at org.scalatest.concurrent.Eventually.eventually(Eventually.scala:313)
[info] at org.scalatest.concurrent.Eventually.eventually$(Eventually.scala:312)
[info] at org.scalatest.concurrent.Eventually$.eventually(Eventually.scala:457)
[info] at org.apache.pekko.persistence.cassandra.query.EventsByTagPersistenceIdCleanupSpec.$anonfun$new$102(EventsByTagSpec.scala:1374)
[info] at org.scalatest.OutcomeOf.outcomeOf(OutcomeOf.scala:85)
[info] at org.scalatest.OutcomeOf.outcomeOf$(OutcomeOf.scala:83)
[info] at org.scalatest.OutcomeOf$.outcomeOf(OutcomeOf.scala:104)
[info] at org.scalatest.Transformer.apply(Transformer.scala:22)
[info] at org.scalatest.Transformer.apply(Transformer.scala:20)
[info] at org.scalatest.wordspec.AnyWordSpecLike$$anon$3.apply(AnyWordSpecLike.scala:1240)
[info] at org.apache.pekko.persistence.cassandra.CassandraSpec.$anonfun$withFixture$1(CassandraSpec.scala:146)
[info] at org.apache.pekko.testkit.EventFilter.intercept(TestEventListener.scala:129)
[info] at org.apache.pekko.persistence.cassandra.CassandraSpec.withFixture(CassandraSpec.scala:144)
[info] at org.scalatest.wordspec.AnyWordSpecLike.invokeWithFixture$1(AnyWordSpecLike.scala:1238)
[info] at org.scalatest.wordspec.AnyWordSpecLike.$anonfun$runTest$1(AnyWordSpecLike.scala:1250)
[info] at org.scalatest.SuperEngine.runTestImpl(Engine.scala:306)
[info] at org.scalatest.wordspec.AnyWordSpecLike.runTest(AnyWordSpecLike.scala:1250)
[info] at org.scalatest.wordspec.AnyWordSpecLike.runTest$(AnyWordSpecLike.scala:1232)
[info] at org.apache.pekko.persistence.cassandra.query.AbstractEventsByTagSpec.org$scalatest$BeforeAndAfterEach$$super$runTest(EventsByTagSpec.scala:144)
[info] at org.scalatest.BeforeAndAfterEach.runTest(BeforeAndAfterEach.scala:234)
[info] at org.scalatest.BeforeAndAfterEach.runTest$(BeforeAndAfterEach.scala:227)
[info] at org.apache.pekko.persistence.cassandra.query.AbstractEventsByTagSpec.runTest(EventsByTagSpec.scala:144)
[info] at org.scalatest.wordspec.AnyWordSpecLike.$anonfun$runTests$1(AnyWordSpecLike.scala:1309)
[info] at org.scalatest.SuperEngine.$anonfun$runTestsInBranch$1(Engine.scala:413)
[info] at scala.collection.immutable.List.foreach(List.scala:334)
[info] at org.scalatest.SuperEngine.traverseSubNodes$1(Engine.scala:401)
[info] at org.scalatest.SuperEngine.runTestsInBranch(Engine.scala:390)
[info] at org.scalatest.SuperEngine.$anonfun$runTestsInBranch$1(Engine.scala:427)
[info] at scala.collection.immutable.List.foreach(List.scala:334)
[info] at org.scalatest.SuperEngine.traverseSubNodes$1(Engine.scala:401)
[info] at org.scalatest.SuperEngine.runTestsInBranch(Engine.scala:396)
[info] at org.scalatest.SuperEngine.runTestsImpl(Engine.scala:475)
[info] at org.scalatest.wordspec.AnyWordSpecLike.runTests(AnyWordSpecLike.scala:1309)
[info] at sbt.TestFramework$$anon$3$$anonfun$$lessinit$greater$1.$anonfun$apply$1(TestFramework.scala:336)
[info] at sbt.TestFramework$.sbt$TestFramework$$withContextLoader(TestFramework.scala:296)
[info] at sbt.TestFramework$$anon$3$$anonfun$$lessinit$greater$1.apply(TestFramework.scala:336)
[info] at sbt.TestFramework$$anon$3$$anonfun$$lessinit$greater$1.apply(TestFramework.scala:336)
[info] at sbt.TestFunction.apply(TestFramework.scala:348)
[info] at sbt.Tests$.processRunnable$1(Tests.scala:475)
[info] at sbt.Tests$.$anonfun$makeSerial$1(Tests.scala:481)
[info] at sbt.std.Transform$$anon$3.$anonfun$apply$2(Transform.scala:47)
[info] at sbt.std.Transform$$anon$4.work(Transform.scala:69)
[info] at sbt.Execute.$anonfun$submit$2(Execute.scala:283)
[info] at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:24)
[info] at sbt.Execute.work(Execute.scala:292)
[info] at sbt.Execute.$anonfun$submit$1(Execute.scala:283)
[info] at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:265)
[info] at sbt.CompletionService$$anon$2.call(CompletionService.scala:65)
[info] at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[info] at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
[info] at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[info] at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
[info] at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
[info] at java.base/java.lang.Thread.run(Thread.java:829)
```

Contributor guide

Open the contributing guide

Research direction

Start at EventsByTagSpec.scala:1374, the failing test named EventsByTagPersistenceIdCleanupSpec: “PersistenceId cleanup must drop state and trigger new persistence id lookup periodically.” Run that test and inspect the cleanup and persistence-id lookup behavior it exercises; done means the test no longer receives the unexpected cleanup-2 event and verifies periodic lookup correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
cassandra, scala
Domain
databases, testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.