[K/N][test] Sync PsiFactory creation
CoreApplicationEnvironment.registerApplicationDynamicExtensionPoint should be guarded to ensure registration won't happen concurrently Merge-request: KT-MR-8251 Merged-by: Pavel Punegov <Pavel.Punegov@jetbrains.com>
This commit is contained in:
committed by
Space Team
parent
37f3b7e816
commit
a90983ca6a
+8
-1
@@ -823,6 +823,8 @@ private class ExtTestDataFileStructureFactory(parentDisposable: Disposable) : Te
|
|||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
private val lock = Object()
|
||||||
|
|
||||||
private fun createPsiFactory(parentDisposable: Disposable): KtPsiFactory {
|
private fun createPsiFactory(parentDisposable: Disposable): KtPsiFactory {
|
||||||
val configuration: CompilerConfiguration = KotlinTestUtils.newConfiguration()
|
val configuration: CompilerConfiguration = KotlinTestUtils.newConfiguration()
|
||||||
configuration.put(CommonConfigurationKeys.MODULE_NAME, "native-blackbox-test-patching-module")
|
configuration.put(CommonConfigurationKeys.MODULE_NAME, "native-blackbox-test-patching-module")
|
||||||
@@ -833,7 +835,12 @@ private class ExtTestDataFileStructureFactory(parentDisposable: Disposable) : Te
|
|||||||
configFiles = EnvironmentConfigFiles.METADATA_CONFIG_FILES
|
configFiles = EnvironmentConfigFiles.METADATA_CONFIG_FILES
|
||||||
)
|
)
|
||||||
|
|
||||||
CoreApplicationEnvironment.registerApplicationDynamicExtensionPoint(TreeCopyHandler.EP_NAME.name, TreeCopyHandler::class.java)
|
synchronized(lock) {
|
||||||
|
CoreApplicationEnvironment.registerApplicationDynamicExtensionPoint(
|
||||||
|
TreeCopyHandler.EP_NAME.name,
|
||||||
|
TreeCopyHandler::class.java
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
val project = environment.project as MockProject
|
val project = environment.project as MockProject
|
||||||
project.registerService(PomModel::class.java, PomModelImpl::class.java)
|
project.registerService(PomModel::class.java, PomModelImpl::class.java)
|
||||||
|
|||||||
Reference in New Issue
Block a user