From e275a44e13ac451c7fbb27ccae4da82647593a73 Mon Sep 17 00:00:00 2001 From: Daniil Ovchinnikov Date: Wed, 17 May 2023 14:17:39 +0200 Subject: [PATCH] close and delete shared light project before running `ParsingTestCase` GitOrigin-RevId: 4a86b2f44bec3a1e9aae637f064f84062326bae0 --- .../src/com/intellij/testFramework/ParsingTestCase.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/platform/testFramework/src/com/intellij/testFramework/ParsingTestCase.java b/platform/testFramework/src/com/intellij/testFramework/ParsingTestCase.java index c5abec340825..956a47c78776 100644 --- a/platform/testFramework/src/com/intellij/testFramework/ParsingTestCase.java +++ b/platform/testFramework/src/com/intellij/testFramework/ParsingTestCase.java @@ -1,4 +1,4 @@ -// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.testFramework; import com.intellij.concurrency.IdeaForkJoinWorkerThreadFactory; @@ -98,6 +98,9 @@ public abstract class ParsingTestCase extends UsefulTestCase { protected void setUp() throws Exception { super.setUp(); + // This makes sure that tasks launched in the shared project are properly cancelled, + // so they don't leak into the mock app of ParsingTestCase. + LightPlatformTestCase.closeAndDeleteProject(); MockApplication app = MockApplication.setUp(getTestRootDisposable()); this.app = app; MutablePicoContainer appContainer = app.getPicoContainer();