diff --git a/src/jvm/test/org/jetbrains/kotlinx/lincheck_test/representation/RecursiveSpinLockTest.kt b/src/jvm/test/org/jetbrains/kotlinx/lincheck_test/representation/RecursiveSpinLockTest.kt index c8f404ac5..ee8c093fc 100644 --- a/src/jvm/test/org/jetbrains/kotlinx/lincheck_test/representation/RecursiveSpinLockTest.kt +++ b/src/jvm/test/org/jetbrains/kotlinx/lincheck_test/representation/RecursiveSpinLockTest.kt @@ -293,3 +293,19 @@ class RecursiveParametersDependentSpinLockTest { .checkImpl(this::class.java) .checkLincheckOutput("spin_lock/recursive_spin_lock_param_dependent.txt") } + +class RecursiveSpinLockRepeatsOperationTest { + private val value = AtomicBoolean(false) + + fun foo() { + if (value.get()) return + foo() + } + + @Test + fun test() = ModelCheckingOptions() + .iterations(0) + .addCustomScenario { parallel { thread { actor(::foo) } } } + .checkImpl(this::class.java) + .checkLincheckOutput("spin_lock/recursive_spin_lock_repeats_operation.txt") +} diff --git a/src/jvm/test/resources/expected_logs/spin_lock/recursive_spin_lock_repeats_operation.txt b/src/jvm/test/resources/expected_logs/spin_lock/recursive_spin_lock_repeats_operation.txt new file mode 100644 index 000000000..e69de29bb