mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IJPL-845 Make opening performance tests wait till full highlight
GitOrigin-RevId: a267a8eb10b303075737865e9a9e4bc459e963ae
This commit is contained in:
committed by
intellij-monorepo-bot
parent
4c4c556d3c
commit
6ac68d13bc
+17
@@ -19,9 +19,12 @@ import com.intellij.openapi.project.DumbService
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.openapi.ui.playback.PlaybackContext
|
||||
import com.intellij.openapi.vfs.VirtualFile
|
||||
import com.intellij.platform.ide.diagnostic.startUpPerformanceReporter.FUSProjectHotStartUpMeasurerService
|
||||
import com.intellij.util.concurrency.annotations.RequiresReadLock
|
||||
import com.intellij.util.ui.UIUtil
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.coroutineScope
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.launch
|
||||
import java.time.Duration
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
@@ -34,6 +37,20 @@ class WaitForFinishedCodeAnalysis(text: String, line: Int) : PerformanceCommandC
|
||||
}
|
||||
|
||||
override suspend fun doExecute(context: PlaybackContext) {
|
||||
val checkingJob = coroutineScope {
|
||||
launch {
|
||||
while (true) {
|
||||
@Suppress("TestOnlyProblems")
|
||||
if (!service<FUSProjectHotStartUpMeasurerService>().isHandlingFinished()) {
|
||||
delay(500)
|
||||
}
|
||||
else {
|
||||
return@launch
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
checkingJob.join()
|
||||
context.project.service<ListenerState>().waitAnalysisToFinish()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user