@@ -44,7 +44,6 @@ import java.util.Collections
44
44
import java.util.SortedSet
45
45
import java.util.TreeSet
46
46
import kotlin.random.Random
47
- import kotlin.test.Ignore
48
47
import kotlin.test.Test
49
48
import kotlin.test.assertEquals
50
49
import kotlin.time.Duration.Companion.milliseconds
@@ -116,9 +115,27 @@ class ReplicatedRepositoryTest {
116
115
}
117
116
}
118
117
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 {
122
139
val url = " http://localhost/v2"
123
140
val clients = (1 .. 3 ).map {
124
141
ModelClientV2 .builder().url(url).client(client).build().also { it.init () }
@@ -145,7 +162,7 @@ class ReplicatedRepositoryTest {
145
162
}
146
163
}
147
164
models.forEachIndexed { index, model ->
148
- launchWriter(model, 56456 + index)
165
+ launchWriter(model, 56456 + index + iteration * 100000 )
149
166
delay(200 .milliseconds)
150
167
}
151
168
}
0 commit comments