Skip to content

Commit e941da2

Browse files
authored
Remove workaround for KT-42671 that triggers test failures from IDEA and access properties in a safe manner from agent premain instead (#2311)
1 parent 993c192 commit e941da2

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

Diff for: kotlinx-coroutines-core/build.gradle

+1-3
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,7 @@ jvmTest {
177177
minHeapSize = '1g'
178178
maxHeapSize = '1g'
179179
enableAssertions = true
180-
if (!Idea.active) { // Workaround for KT-42671
181-
systemProperty 'java.security.manager', 'kotlinx.coroutines.TestSecurityManager'
182-
}
180+
systemProperty 'java.security.manager', 'kotlinx.coroutines.TestSecurityManager'
183181
// 'stress' is required to be able to run all subpackage tests like ":jvmTests --tests "*channels*" -Pstress=true"
184182
if (!Idea.active && rootProject.properties['stress'] == null) {
185183
exclude '**/*StressTest.*'

Diff for: kotlinx-coroutines-core/jvm/src/debug/AgentPremain.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ internal object AgentPremain {
2121

2222
public var isInstalledStatically = false
2323

24-
private val enableCreationStackTraces =
24+
private val enableCreationStackTraces = runCatching {
2525
System.getProperty("kotlinx.coroutines.debug.enable.creation.stack.trace")?.toBoolean()
26-
?: DebugProbesImpl.enableCreationStackTraces
26+
}.getOrNull() ?: DebugProbesImpl.enableCreationStackTraces
2727

2828
@JvmStatic
2929
public fun premain(args: String?, instrumentation: Instrumentation) {

0 commit comments

Comments
 (0)