diff --git a/plugins/svn4idea/testSource/org/jetbrains/idea/svn/SvnTestCase.java b/plugins/svn4idea/testSource/org/jetbrains/idea/svn/SvnTestCase.java index 944a1d3e2b89..7c4463e4034d 100644 --- a/plugins/svn4idea/testSource/org/jetbrains/idea/svn/SvnTestCase.java +++ b/plugins/svn4idea/testSource/org/jetbrains/idea/svn/SvnTestCase.java @@ -23,6 +23,7 @@ import com.intellij.openapi.vcs.rollback.RollbackProgressListener; import com.intellij.openapi.vcs.update.CommonUpdateProjectAction; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.testFramework.ApplicationRule; +import com.intellij.testFramework.RunAll; import com.intellij.testFramework.fixtures.IdeaTestFixtureFactory; import com.intellij.testFramework.fixtures.TempDirTestFixture; import com.intellij.testFramework.vcs.AbstractJunitVcsTestCase; @@ -207,15 +208,28 @@ public abstract class SvnTestCase extends AbstractJunitVcsTestCase { @After public void tearDown() throws Exception { - runInEdtAndWait(() -> { - tearDownProject(); + runInEdtAndWait( + () -> new RunAll( + this::waitChangeListManager, + this::tearDownProject, + this::tearDownTempDirectoryFixture, + () -> resetCanonicalTempPathCache(ORIGINAL_TEMP_DIRECTORY) + ).run() + ); + } - if (myTempDirFixture != null) { - myTempDirFixture.tearDown(); - myTempDirFixture = null; - } - resetCanonicalTempPathCache(ORIGINAL_TEMP_DIRECTORY); - }); + private void waitChangeListManager() { + if (changeListManager != null) { + changeListManager.forceStopInTestMode(); + changeListManager.waitEverythingDoneInTestMode(); + } + } + + private void tearDownTempDirectoryFixture() throws Exception { + if (myTempDirFixture != null) { + myTempDirFixture.tearDown(); + myTempDirFixture = null; + } } protected ProcessOutput runSvn(String... commandLine) throws IOException {