@@ -26,6 +26,8 @@ import kotlinx.coroutines.coroutineScope
26
26
import kotlinx.coroutines.delay
27
27
import kotlinx.coroutines.launch
28
28
import kotlinx.coroutines.withTimeout
29
+ import org.junit.jupiter.api.RepeatedTest
30
+ import org.junit.jupiter.api.RepetitionInfo
29
31
import org.modelix.authorization.installAuthentication
30
32
import org.modelix.model.LinearHistory
31
33
import org.modelix.model.ModelFacade
@@ -127,27 +129,8 @@ class ReplicatedRepositoryTest {
127
129
}
128
130
}
129
131
130
- @Test fun `concurrent write 0` () = concurrentWrite(0 )
131
-
132
- @Test fun `concurrent write 1` () = concurrentWrite(1 )
133
-
134
- @Test fun `concurrent write 2` () = concurrentWrite(2 )
135
-
136
- @Test fun `concurrent write 3` () = concurrentWrite(3 )
137
-
138
- @Test fun `concurrent write 4` () = concurrentWrite(4 )
139
-
140
- @Test fun `concurrent write 5` () = concurrentWrite(5 )
141
-
142
- @Test fun `concurrent write 6` () = concurrentWrite(6 )
143
-
144
- @Test fun `concurrent write 7` () = concurrentWrite(7 )
145
-
146
- @Test fun `concurrent write 8` () = concurrentWrite(8 )
147
-
148
- @Test fun `concurrent write 9` () = concurrentWrite(9 )
149
-
150
- fun concurrentWrite (iteration : Int ) = runTest { scope ->
132
+ @RepeatedTest(value = 10 )
133
+ fun concurrentWrite (repetitionInfo : RepetitionInfo ) = runTest { scope ->
151
134
val url = " http://localhost/v2"
152
135
val clients = (1 .. 3 ).map {
153
136
ModelClientV2 .builder().url(url).client(client).build().also { it.init () }
@@ -175,7 +158,7 @@ class ReplicatedRepositoryTest {
175
158
}
176
159
}
177
160
models.forEachIndexed { index, model ->
178
- launchWriter(model, 56456 + index + iteration * 100000 )
161
+ launchWriter(model, 56456 + index + repetitionInfo.currentRepetition * 100000 )
179
162
delay(200 .milliseconds)
180
163
}
181
164
}
0 commit comments