apache / apache/pekko-persistence-r2dbc
Flaky test: "must handle all events exactlyOnce"
- Dominant language
- Scala
- Stars
- 21
- Forks
- 14
- Avg merge
- 13h 51m
- Merged PRs (30d)
- 15
Description
```
[info] - must handle all events exactlyOnce *** FAILED *** (53 seconds, 598 milliseconds)
[info] java.lang.AssertionError: Timeout (30 seconds) during receiveMessage while waiting for message.
[info] at org.apache.pekko.actor.testkit.typed.internal.TestProbeImpl.$anonfun$receiveMessage_internal$1(TestProbeImpl.scala:410)
[info] at scala.Option.getOrElse(Option.scala:201)
[info] at org.apache.pekko.actor.testkit.typed.internal.TestProbeImpl.receiveMessage_internal(TestProbeImpl.scala:193)
[info] at org.apache.pekko.actor.testkit.typed.internal.TestProbeImpl.receiveMessage(TestProbeImpl.scala:190)
[info] at org.apache.pekko.projection.r2dbc.EventSourcedChaosSpec.$anonfun$new$7(EventSourcedChaosSpec.scala:204)
[info] at scala.collection.immutable.Range.foreach$mVc$sp(Range.scala:192)
[info] at org.apache.pekko.projection.r2dbc.EventSourcedChaosSpec.$anonfun$new$15(EventSourcedChaosSpec.scala:201)
[info] at scala.collection.immutable.Range.foreach$mVc$sp(Range.scala:192)
[info] at org.apache.pekko.projection.r2dbc.EventSourcedChaosSpec.$anonfun$new$2(EventSourcedChaosSpec.scala:239)
[info] at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
[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.actor.testkit.typed.scaladsl.LogCapturing.withFixture(LogCapturing.scala:79)
[info] at org.apache.pekko.actor.testkit.typed.scaladsl.LogCapturing.withFixture$(LogCapturing.scala:77)
[info] at org.apache.pekko.projection.r2dbc.EventSourcedChaosSpec.withFixture(EventSourcedChaosSpec.scala:105)
[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.projection.r2dbc.EventSourcedChaosSpec.runTest(EventSourcedChaosSpec.scala:105)
[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 org.scalatest.wordspec.AnyWordSpecLike.runTests$(AnyWordSpecLike.scala:1308)
[info] at org.apache.pekko.projection.r2dbc.EventSourcedChaosSpec.runTests(EventSourcedChaosSpec.scala:105)
[info] at org.scalatest.Suite.run(Suite.scala:1114)
[info] at org.scalatest.Suite.run$(Suite.scala:1096)
[info] at org.apache.pekko.actor.testkit.typed.scaladsl.ScalaTestWithActorTestKit.org$scalatest$BeforeAndAfterAll$$super$run(ScalaTestWithActorTestKit.scala:41)
[info] at org.scalatest.BeforeAndAfterAll.liftedTree1$1(BeforeAndAfterAll.scala:213)
[info] at org.scalatest.BeforeAndAfterAll.run(BeforeAndAfterAll.scala:210)
[info] at org.scalatest.BeforeAndAfterAll.run$(BeforeAndAfterAll.scala:208)
[info] at org.apache.pekko.projection.r2dbc.EventSourcedChaosSpec.org$scalatest$wordspec$AnyWordSpecLike$$super$run(EventSourcedChaosSpec.scala:105)
[info] at org.scalatest.wordspec.AnyWordSpecLike.$anonfun$run$1(AnyWordSpecLike.scala:1354)
[info] at org.scalatest.SuperEngine.runImpl(Engine.scala:535)
[info] at org.scalatest.wordspec.AnyWordSpecLike.run(AnyWordSpecLike.scala:1354)
[info] at org.scalatest.wordspec.AnyWordSpecLike.run$(AnyWordSpecLike.scala:1352)
[info] at org.apache.pekko.projection.r2dbc.EventSourcedChaosSpec.run(EventSourcedChaosSpec.scala:105)
[info] at org.scalatest.tools.Framework.org$scalatest$tools$Framework$$runSuite(Framework.scala:321)
[info] at org.scalatest.tools.Framework$ScalaTestTask.execute(Framework.scala:517)
[info] at sbt.ForkMain$Run.lambda$runTest$1(ForkMain.java:414)
[info] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[info] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[info] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[info] at java.lang.Thread.run(Thread.java:750)
[info] + Iteration #1. Processed [240] events in [2] projections from [44] pids.
```
Contributor guide
Research direction
Start with EventSourcedChaosSpec.scala, especially the event loop around lines 201 and 204 and the enclosing test at line 239. Run the failing "must handle all events exactlyOnce" test repeatedly and inspect the timeout while waiting for messages. Done means the test reliably processes all 240 events across the two projections without timing out.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- scala
- Domain
- databases, testing
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100