Skip to content

Commit 9497bc8

Browse files
committed
test: run unstable test 10 times to make it more likely to fail
1 parent 7741f9f commit 9497bc8

File tree

1 file changed

+22
-5
lines changed

1 file changed

+22
-5
lines changed

model-server/src/test/kotlin/org/modelix/model/server/ReplicatedRepositoryTest.kt

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ import java.util.Collections
4444
import java.util.SortedSet
4545
import java.util.TreeSet
4646
import kotlin.random.Random
47-
import kotlin.test.Ignore
4847
import kotlin.test.Test
4948
import kotlin.test.assertEquals
5049
import kotlin.time.Duration.Companion.milliseconds
@@ -116,9 +115,27 @@ class ReplicatedRepositoryTest {
116115
}
117116
}
118117

119-
@Ignore
120-
@Test
121-
fun `concurrent write`() = runTest {
118+
@Test fun `concurrent write 0`() = concurrentWrite(0)
119+
120+
@Test fun `concurrent write 1`() = concurrentWrite(1)
121+
122+
@Test fun `concurrent write 2`() = concurrentWrite(2)
123+
124+
@Test fun `concurrent write 3`() = concurrentWrite(3)
125+
126+
@Test fun `concurrent write 4`() = concurrentWrite(4)
127+
128+
@Test fun `concurrent write 5`() = concurrentWrite(5)
129+
130+
@Test fun `concurrent write 6`() = concurrentWrite(6)
131+
132+
@Test fun `concurrent write 7`() = concurrentWrite(7)
133+
134+
@Test fun `concurrent write 8`() = concurrentWrite(8)
135+
136+
@Test fun `concurrent write 9`() = concurrentWrite(9)
137+
138+
fun concurrentWrite(iteration: Int) = runTest {
122139
val url = "http://localhost/v2"
123140
val clients = (1..3).map {
124141
ModelClientV2.builder().url(url).client(client).build().also { it.init() }
@@ -145,7 +162,7 @@ class ReplicatedRepositoryTest {
145162
}
146163
}
147164
models.forEachIndexed { index, model ->
148-
launchWriter(model, 56456 + index)
165+
launchWriter(model, 56456 + index + iteration * 100000)
149166
delay(200.milliseconds)
150167
}
151168
}

0 commit comments

Comments
 (0)