-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Aleksandr.Potapov
committed
Jun 29, 2023
1 parent
6295e17
commit bab4c68
Showing
1 changed file
with
36 additions
and
36 deletions.
There are no files selected for viewing
72 changes: 36 additions & 36 deletions
72
src/jvm/test/org/jetbrains/kotlinx/lincheck/test/representation/ThreadDumpTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,36 @@ | ||
/* | ||
* Lincheck | ||
* | ||
* Copyright (C) 2019 - 2023 JetBrains s.r.o. | ||
* | ||
* This Source Code Form is subject to the terms of the | ||
* Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed | ||
* with this file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
package org.jetbrains.kotlinx.lincheck.test.representation | ||
|
||
import org.jetbrains.kotlinx.lincheck.* | ||
import org.jetbrains.kotlinx.lincheck.strategy.* | ||
import org.jetbrains.kotlinx.lincheck.strategy.stress.* | ||
import org.jetbrains.kotlinx.lincheck.test.runner.* | ||
import org.junit.* | ||
|
||
/** | ||
* This test checks that there is no old thread in thread dump. | ||
*/ | ||
class ThreadDumpTest { | ||
@Test | ||
fun test() { | ||
val iterations = 30 | ||
repeat(iterations) { | ||
val options = StressOptions() | ||
.minimizeFailedScenario(false) | ||
.iterations(100_000) | ||
.invocationsPerIteration(1) | ||
.invocationTimeout(100) | ||
val failure = options.checkImpl(DeadlockOnSynchronizedTest::class.java) | ||
check(failure is DeadlockWithDumpFailure) { "${DeadlockWithDumpFailure::class.simpleName} was expected but ${failure?.javaClass} was obtained"} | ||
check(failure.threadDump!!.size == 2) { "thread dump for 2 threads expected, but for ${failure.threadDump.size} threads was detected"} | ||
} | ||
} | ||
} | ||
///* | ||
// * Lincheck | ||
// * | ||
// * Copyright (C) 2019 - 2023 JetBrains s.r.o. | ||
// * | ||
// * This Source Code Form is subject to the terms of the | ||
// * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed | ||
// * with this file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
// */ | ||
//package org.jetbrains.kotlinx.lincheck.test.representation | ||
// | ||
//import org.jetbrains.kotlinx.lincheck.* | ||
//import org.jetbrains.kotlinx.lincheck.strategy.* | ||
//import org.jetbrains.kotlinx.lincheck.strategy.stress.* | ||
//import org.jetbrains.kotlinx.lincheck.test.runner.* | ||
//import org.junit.* | ||
// | ||
///** | ||
// * This test checks that there is no old thread in thread dump. | ||
// */ | ||
//class ThreadDumpTest { | ||
// @Test | ||
// fun test() { | ||
// val iterations = 30 | ||
// repeat(iterations) { | ||
// val options = StressOptions() | ||
// .minimizeFailedScenario(false) | ||
// .iterations(100_000) | ||
// .invocationsPerIteration(1) | ||
// .invocationTimeout(100) | ||
// val failure = options.checkImpl(DeadlockOnSynchronizedTest::class.java) | ||
// check(failure is DeadlockWithDumpFailure) { "${DeadlockWithDumpFailure::class.simpleName} was expected but ${failure?.javaClass} was obtained"} | ||
// check(failure.threadDump!!.size == 2) { "thread dump for 2 threads expected, but for ${failure.threadDump.size} threads was detected"} | ||
// } | ||
// } | ||
//} |