mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Don't report freezes due without known reasons
GC for example (cherry picked from commit 0a40e58b2ec55f0f7034a4839548639c2db4c979) IJ-CR-146685 GitOrigin-RevId: 6ffde74e6ac95b7bf981605ec9fbcc220aba8c56
This commit is contained in:
committed by
intellij-monorepo-bot
parent
20e49c5820
commit
8c61cdf9db
+2
-1
@@ -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
|
||||
}
|
||||
|
||||
+6
@@ -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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user