More debug for Necropolis in tests checking caches

GitOrigin-RevId: 5292b00111c0427e14a4b82749763d8a1e52962b
This commit is contained in:
Elena Shaverdova
2024-08-19 17:08:36 +02:00
committed by intellij-monorepo-bot
parent ade2a59ae0
commit eaf0d8ef16

View File

@@ -5,7 +5,6 @@ import com.intellij.ide.plugins.PluginManagerCore
import com.intellij.openapi.Disposable
import com.intellij.openapi.application.PathManager
import com.intellij.openapi.application.WriteIntentReadAction
import com.intellij.openapi.application.ex.ApplicationManagerEx
import com.intellij.openapi.application.readActionBlocking
import com.intellij.openapi.components.Service
import com.intellij.openapi.components.service
@@ -135,26 +134,26 @@ class Necropolis(private val project: Project, private val coroutineScope: Corou
necromancer to zombie
}
}.toList()
if (LOG.isDebugEnabled) {
LOG.debug("Turned into zombies for ${recipe.fileId}: ${zombies.map { it.first.name() }}")
}
if (zombies.isNotEmpty()) {
coroutineScope.launch {
val documentContent = readActionBlocking {
if (recipe.isValid()) {
recipe.document.immutableCharSequence
} else {
LOG.debug("Invalid recipe for ${recipe.fileId}}")
null
}
}
if (documentContent != null) {
val fingerprint = FingerprintedZombieImpl.captureFingerprint(documentContent)
for ((necromancer, zombie) in zombies) {
val context = if (ApplicationManagerEx.isInIntegrationTest()){
CoroutineName(necromancer.name()) + NonCancellable
} else {
CoroutineName(necromancer.name())
}
launch(context) {
launch(CoroutineName(necromancer.name())) {
if (recipe.isValid() && necromancer.shouldBuryZombie(recipe, zombie)) {
necromancer.buryZombie(recipe.fileId, FingerprintedZombieImpl(fingerprint, zombie))
LOG.debug("Buried ${necromancer.name()} for ${recipe.fileId}")
}
}
}