File tree 1 file changed +6
-4
lines changed
core/src/test/scala/akka/persistence/r2dbc/cleanup/scaladsl
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -55,11 +55,13 @@ class EventSourcedCleanupSpec
55
55
56
56
// find two different persistenceIds that are both in the slice range 0-255 so that this test can run with
57
57
// 4 data partitions
58
- private def pidsWithSliceLessThan256 (entityType : String ) = {
58
+ private def pidsWithDifferentSlicesLessThan256 (entityType : String ) = {
59
59
var pid1 : PersistenceId = null
60
60
var pid2 : PersistenceId = null
61
- while (pid1 == pid2 || persistenceExt.sliceForPersistenceId(pid1.id) > 255 || persistenceExt
62
- .sliceForPersistenceId(pid2.id) > 255 ) {
61
+ def slice1 = persistenceExt.sliceForPersistenceId(pid1.id)
62
+ def slice2 = persistenceExt.sliceForPersistenceId(pid2.id)
63
+
64
+ while (pid1 == pid2 || slice1 == slice2 || slice1 > 255 || slice2 > 255 ) {
63
65
pid1 = PersistenceId (entityType, UUID .randomUUID().toString)
64
66
pid2 = PersistenceId (entityType, UUID .randomUUID().toString)
65
67
}
@@ -393,7 +395,7 @@ class EventSourcedCleanupSpec
393
395
val ackProbe = createTestProbe[Done ]()
394
396
val entityType = nextEntityType()
395
397
396
- var (pid1, pid2) = pidsWithSliceLessThan256 (entityType)
398
+ var (pid1, pid2) = pidsWithDifferentSlicesLessThan256 (entityType)
397
399
398
400
val p1 = spawn(Persister (pid1))
399
401
val p2 = spawn(Persister (pid2))
You can’t perform that action at this time.
0 commit comments