diff --git a/platform/diagnostic/freezeAnalyzer/src/com/intellij/platform/diagnostic/freezeAnalyzer/FreezeAnalyzer.kt b/platform/diagnostic/freezeAnalyzer/src/com/intellij/platform/diagnostic/freezeAnalyzer/FreezeAnalyzer.kt index 3eff108aa9ed..f0bb3d3a2164 100644 --- a/platform/diagnostic/freezeAnalyzer/src/com/intellij/platform/diagnostic/freezeAnalyzer/FreezeAnalyzer.kt +++ b/platform/diagnostic/freezeAnalyzer/src/com/intellij/platform/diagnostic/freezeAnalyzer/FreezeAnalyzer.kt @@ -21,7 +21,8 @@ object FreezeAnalyzer { when { !edt.isWaiting && !edt.isSleeping -> findFirstRelevantMethod(edt.stackTrace)?.let { FreezeAnalysisResult("EDT is busy with $it", listOf(edt)) } edt.isWaiting && isWriteLockWait(edt) -> findThreadThatTookReadWriteLock(threadDumpParsed)?.let { FreezeAnalysisResult(it.message, it.threads + listOf(edt), it.additionalMessage) } - edt.isWaiting && !isEDTFreezed(edt) -> FreezeAnalysisResult("${testName ?: ""}: EDT is not blocked/busy (freeze can be the result of extensive GC)", listOf(edt)) + edt.isWaiting && !isEDTFreezed(edt) && testName == null -> null + edt.isWaiting && !isEDTFreezed(edt) && testName != null -> FreezeAnalysisResult("${testName}: EDT is not blocked/busy (freeze can be the result of extensive GC)", listOf(edt)) edt.isWaiting -> analyzeLock(edt, threadDumpParsed) else -> null } diff --git a/platform/diagnostic/freezeAnalyzer/testSrc/com/intellij/platform/diagnostic/freezeAnalyzer/FreezeAnalyzerTest.kt b/platform/diagnostic/freezeAnalyzer/testSrc/com/intellij/platform/diagnostic/freezeAnalyzer/FreezeAnalyzerTest.kt index 8270a14a2b7c..5817524ed99b 100644 --- a/platform/diagnostic/freezeAnalyzer/testSrc/com/intellij/platform/diagnostic/freezeAnalyzer/FreezeAnalyzerTest.kt +++ b/platform/diagnostic/freezeAnalyzer/testSrc/com/intellij/platform/diagnostic/freezeAnalyzer/FreezeAnalyzerTest.kt @@ -120,4 +120,10 @@ class FreezeAnalyzerTest { val threadDump = File(this::class.java.classLoader.getResource("freezes/noFreeze/lowMemory.txt")!!.path).toPath().readText() FreezeAnalyzer.analyzeFreeze(threadDump, testName = "kotlin/testCase")?.message.shouldBe("kotlin/testCase: EDT is not blocked/busy (freeze can be the result of extensive GC)") } + + @Test + fun testNoFreezeOutsideOfTest() { + val threadDump = File(this::class.java.classLoader.getResource("freezes/noFreeze/lowMemory.txt")!!.path).toPath().readText().replace("2.", ".") + FreezeAnalyzer.analyzeFreeze(threadDump, testName = null)?.shouldBe(null) + } } \ No newline at end of file