mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-06 03:21:12 +07:00
IJPL-578 log "waitNow will be waiting" in tests
"waitNow will be waiting" in test log means that test behavior has been changed by IndexingTestUtil: some indexing tasks that supposed to run synchronously didn't finish yet, and IndexingTestUtil will wait for them. In most cases tests are running on EDT, so this means that IndexingTestUtil will pump EDT events, which may change test behavior (e.g. some write action may occur and invalidate something, e.g. highlighting) GitOrigin-RevId: bd530f882840ff83fdc5c1ab6901c2fa9b9430e2
This commit is contained in:
committed by
intellij-monorepo-bot
parent
a82baf0789
commit
ffe26e54cd
@@ -74,7 +74,11 @@ class IndexingTestUtil(private val project: Project) {
|
||||
thisLogger().debug("waitNow, thread=${Thread.currentThread()}")
|
||||
Assert.assertFalse("Should not be invoked from write action", ApplicationManager.getApplication().isWriteAccessAllowed)
|
||||
|
||||
if (!isRunning()) return // TODO: CodeInsightTestFixtureImpl.configureInner via GroovyHighlightUsagesTest
|
||||
if (!isRunning()) {
|
||||
return // TODO: CodeInsightTestFixtureImpl.configureInner via GroovyHighlightUsagesTest
|
||||
} else {
|
||||
thisLogger().warn("waitNow will be waiting, thread=${Thread.currentThread()}", Throwable())
|
||||
}
|
||||
|
||||
if (ApplicationManager.getApplication().isWriteIntentLockAcquired) {
|
||||
val scope = GlobalScope.namedChildScope("Indexing waiter", Dispatchers.IO)
|
||||
@@ -102,6 +106,11 @@ class IndexingTestUtil(private val project: Project) {
|
||||
}
|
||||
|
||||
suspend fun suspendUntilIndexesAreReady() {
|
||||
if (!isRunning()) {
|
||||
return
|
||||
} else {
|
||||
thisLogger().warn("suspendUntilIndexesAreReady will be waiting, thread=${Thread.currentThread()}", Throwable())
|
||||
}
|
||||
UnindexedFilesScannerExecutor.getInstance(project).waitUntilFinished()
|
||||
DumbServiceImpl.getInstance(project).waitUntilFinished()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user