Skip to content

Commit c1cb323

Browse files
authored
Bump Lincheck version to 2.17 (#3720)
Signed-off-by: Nikita Koval <[email protected]>
1 parent 4bc89e2 commit c1cb323

8 files changed

+5
-23
lines changed

gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ junit5_version=5.7.0
1313
atomicfu_version=0.20.2
1414
knit_version=0.4.0
1515
html_version=0.7.2
16-
lincheck_version=2.16
16+
lincheck_version=2.17
1717
dokka_version=1.8.10
1818
byte_buddy_version=1.10.9
1919
reactor_version=3.4.1

kotlinx-coroutines-core/jvm/test/AbstractLincheckTest.kt

+1-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import org.jetbrains.kotlinx.lincheck.strategy.stress.*
99
import org.jetbrains.kotlinx.lincheck.verifier.*
1010
import org.junit.*
1111

12-
abstract class AbstractLincheckTest : VerifierState() {
12+
abstract class AbstractLincheckTest {
1313
open fun <O: Options<O, *>> O.customize(isStressTest: Boolean): O = this
1414
open fun ModelCheckingOptions.customize(isStressTest: Boolean): ModelCheckingOptions = this
1515
open fun StressOptions.customize(isStressTest: Boolean): StressOptions = this
@@ -41,6 +41,4 @@ abstract class AbstractLincheckTest : VerifierState() {
4141
.actorsPerThread(if (isStressTest) 3 else 2)
4242
.actorsAfter(if (isStressTest) 3 else 0)
4343
.customize(isStressTest)
44-
45-
override fun extractState(): Any = error("Not implemented")
4644
}

kotlinx-coroutines-core/jvm/test/internal/OnDemandAllocatingPoolLincheckTest.kt

-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ abstract class OnDemandAllocatingPoolLincheckTest(maxCapacity: Int) : AbstractLi
2727

2828
@Operation
2929
fun close(): String = pool.close().sorted().toString()
30-
31-
override fun extractState(): Any = pool.stateRepresentation()
3230
}
3331

3432
abstract class OnDemandAllocatingSequentialPool(private val maxCapacity: Int) {

kotlinx-coroutines-core/jvm/test/lincheck/ChannelsLincheckTest.kt

+1-4
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import org.jetbrains.kotlinx.lincheck.annotations.*
1616
import org.jetbrains.kotlinx.lincheck.annotations.Operation
1717
import org.jetbrains.kotlinx.lincheck.paramgen.*
1818
import org.jetbrains.kotlinx.lincheck.strategy.managed.modelchecking.*
19-
import org.jetbrains.kotlinx.lincheck.verifier.*
2019

2120
class RendezvousChannelLincheckTest : ChannelLincheckTestBaseWithOnSend(
2221
c = Channel(RENDEZVOUS),
@@ -176,7 +175,7 @@ private class NumberedCancellationException(number: Int) : CancellationException
176175
}
177176

178177

179-
abstract class SequentialIntChannelBase(private val capacity: Int) : VerifierState() {
178+
abstract class SequentialIntChannelBase(private val capacity: Int) {
180179
private val senders = ArrayList<Pair<CancellableContinuation<Any>, Int>>()
181180
private val receivers = ArrayList<CancellableContinuation<Any>>()
182181
private val buffer = ArrayList<Int>()
@@ -266,8 +265,6 @@ abstract class SequentialIntChannelBase(private val capacity: Int) : VerifierSta
266265
if (closedMessage !== null) return false
267266
return buffer.isEmpty() && senders.isEmpty()
268267
}
269-
270-
override fun extractState() = buffer to closedMessage
271268
}
272269

273270
private fun <T> CancellableContinuation<T>.resume(res: T): Boolean {

kotlinx-coroutines-core/jvm/test/lincheck/LockFreeTaskQueueLincheckTest.kt

+1-4
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ internal abstract class AbstractLockFreeTaskQueueWithoutRemoveLincheckTest(
3030
override fun <O : Options<O, *>> O.customize(isStressTest: Boolean): O =
3131
verifier(QuiescentConsistencyVerifier::class.java)
3232

33-
override fun extractState() = q.map { it } to q.isClosed()
34-
3533
override fun ModelCheckingOptions.customize(isStressTest: Boolean) =
3634
checkObstructionFreedom()
3735
}
@@ -42,9 +40,8 @@ internal class MCLockFreeTaskQueueWithRemoveLincheckTest : AbstractLockFreeTaskQ
4240
fun removeFirstOrNull() = q.removeFirstOrNull()
4341
}
4442

45-
@OpGroupConfig(name = "consumer", nonParallel = true)
4643
internal class SCLockFreeTaskQueueWithRemoveLincheckTest : AbstractLockFreeTaskQueueWithoutRemoveLincheckTest(singleConsumer = true) {
4744
@QuiescentConsistent
48-
@Operation(group = "consumer")
45+
@Operation(nonParallelGroup = "consumer")
4946
fun removeFirstOrNull() = q.removeFirstOrNull()
5047
}

kotlinx-coroutines-core/jvm/test/lincheck/MutexLincheckTest.kt

-3
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,5 @@ class MutexLincheckTest : AbstractLincheckTest() {
4040
override fun <O : Options<O, *>> O.customize(isStressTest: Boolean): O =
4141
actorsBefore(0)
4242

43-
// state[i] == true <=> mutex.holdsLock(i) with the only exception for 0 that specifies `null`.
44-
override fun extractState() = (1..2).map { mutex.holdsLock(it) } + mutex.isLocked
45-
4643
private val Int.asOwnerOrNull get() = if (this == 0) null else this
4744
}

kotlinx-coroutines-core/jvm/test/lincheck/ResizableAtomicArrayLincheckTest.kt

+1-4
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,14 @@ import org.jetbrains.kotlinx.lincheck.paramgen.*
1111

1212
@Param(name = "index", gen = IntGen::class, conf = "0:4")
1313
@Param(name = "value", gen = IntGen::class, conf = "1:5")
14-
@OpGroupConfig(name = "sync", nonParallel = true)
1514
class ResizableAtomicArrayLincheckTest : AbstractLincheckTest() {
1615
private val a = ResizableAtomicArray<Int>(2)
1716

1817
@Operation
1918
fun get(@Param(name = "index") index: Int): Int? = a[index]
2019

21-
@Operation(group = "sync")
20+
@Operation(nonParallelGroup = "writer")
2221
fun set(@Param(name = "index") index: Int, @Param(name = "value") value: Int) {
2322
a.setSynchronized(index, value)
2423
}
25-
26-
override fun extractState() = (0..4).map { a[it] }
2724
}

kotlinx-coroutines-core/jvm/test/lincheck/SemaphoreLincheckTest.kt

-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ abstract class SemaphoreLincheckTestBase(permits: Int) : AbstractLincheckTest()
2525
override fun <O : Options<O, *>> O.customize(isStressTest: Boolean): O =
2626
actorsBefore(0)
2727

28-
override fun extractState() = semaphore.availablePermits
29-
3028
override fun ModelCheckingOptions.customize(isStressTest: Boolean) =
3129
checkObstructionFreedom()
3230
}

0 commit comments

Comments
 (0)