From 94f852346ca5e2a66b47bc404ca53ba19d99fb5c Mon Sep 17 00:00:00 2001 From: peter Date: Thu, 12 Jan 2017 18:47:45 +0100 Subject: [PATCH] dispose test project in a write action --- .../src/com/intellij/testFramework/LightPlatformTestCase.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/platform/testFramework/src/com/intellij/testFramework/LightPlatformTestCase.java b/platform/testFramework/src/com/intellij/testFramework/LightPlatformTestCase.java index 83a5be9f6d12..aae102f64e2c 100644 --- a/platform/testFramework/src/com/intellij/testFramework/LightPlatformTestCase.java +++ b/platform/testFramework/src/com/intellij/testFramework/LightPlatformTestCase.java @@ -33,6 +33,7 @@ import com.intellij.openapi.Disposable; import com.intellij.openapi.actionSystem.DataProvider; import com.intellij.openapi.application.Application; import com.intellij.openapi.application.ApplicationManager; +import com.intellij.openapi.application.WriteAction; import com.intellij.openapi.application.ex.ApplicationEx; import com.intellij.openapi.application.impl.ApplicationInfoImpl; import com.intellij.openapi.command.WriteCommandAction; @@ -630,7 +631,7 @@ public abstract class LightPlatformTestCase extends UsefulTestCase implements Da if (!ourProject.isDisposed()) { @SuppressWarnings("ConstantConditions") File ioFile = new File(ourProject.getProjectFilePath()); - Disposer.dispose(ourProject); + WriteAction.run(() -> Disposer.dispose(ourProject)); if (ioFile.exists()) { File dir = ioFile.getParentFile(); if (dir.getName().startsWith(UsefulTestCase.TEMP_DIR_MARKER)) {