@@ -11,11 +11,11 @@ import kotlinx.coroutines.channels.Channel.Factory.CONFLATED
11
11
import kotlinx.coroutines.channels.Channel.Factory.RENDEZVOUS
12
12
import kotlinx.coroutines.channels.Channel.Factory.UNLIMITED
13
13
import kotlinx.coroutines.selects.*
14
+ import org.jetbrains.kotlinx.lincheck.*
14
15
import org.jetbrains.kotlinx.lincheck.annotations.*
15
16
import org.jetbrains.kotlinx.lincheck.annotations.Operation
16
17
import org.jetbrains.kotlinx.lincheck.paramgen.*
17
18
import org.jetbrains.kotlinx.lincheck.verifier.*
18
- import org.junit.*
19
19
20
20
class RendezvousChannelLCStressTest : ChannelLCStressTestBase (
21
21
c = Channel (RENDEZVOUS ),
@@ -51,7 +51,10 @@ class SequentialConflatedChannel : SequentialIntChannelBase(CONFLATED)
51
51
Param (name = " value" , gen = IntGen ::class , conf = " 1:5" ),
52
52
Param (name = " closeToken" , gen = IntGen ::class , conf = " 1:3" )
53
53
)
54
- abstract class ChannelLCStressTestBase (private val c : Channel <Int >, private val sequentialSpecification : Class <* >) {
54
+ abstract class ChannelLCStressTestBase (
55
+ private val c : Channel <Int >,
56
+ private val sequentialSpecification : Class <* >
57
+ ) : AbstractLincheckTest() {
55
58
@Operation
56
59
suspend fun send (@Param(name = " value" ) value : Int ): Any = try {
57
60
c.send(value)
@@ -113,11 +116,8 @@ abstract class ChannelLCStressTestBase(private val c: Channel<Int>, private val
113
116
// @Operation
114
117
fun isEmpty () = c.isEmpty
115
118
116
- @Test
117
- fun test () = LCStressOptionsDefault ()
118
- .actorsBefore(0 )
119
- .sequentialSpecification(sequentialSpecification)
120
- .check(this ::class )
119
+ override fun <O : Options <O , * >> O.customize (isStressTest : Boolean ): O =
120
+ actorsBefore(0 ).sequentialSpecification(sequentialSpecification)
121
121
}
122
122
123
123
private class NumberedCancellationException (number : Int ) : CancellationException() {
0 commit comments