@@ -3,11 +3,13 @@ package org.jetbrains.plugins.scala.compiler
3
3
import com .intellij .debugger .impl .OutputChecker
4
4
import com .intellij .execution .ExecutionTestCase
5
5
import com .intellij .execution .configurations .JavaParameters
6
+ import com .intellij .openapi .application .ApplicationManager
6
7
import com .intellij .openapi .diagnostic .Logger
7
8
import com .intellij .openapi .projectRoots .Sdk
8
9
import com .intellij .openapi .vfs .LocalFileSystem
9
10
import com .intellij .pom .java .LanguageLevel
10
11
import com .intellij .testFramework .EdtTestUtil
12
+ import com .intellij .testFramework .common .ThreadLeakTracker
11
13
import org .jetbrains .plugins .scala .base .libraryLoaders .{HeavyJDKLoader , LibraryLoader , ScalaSDKLoader , SmartJDKLoader }
12
14
import org .jetbrains .plugins .scala .base .{ScalaSdkOwner , SourceRootTestUtil }
13
15
import org .jetbrains .plugins .scala .extensions .PathExt
@@ -74,6 +76,8 @@ trait ScalaExecutionTestCase extends ExecutionTestCase with ScalaSdkOwner {
74
76
75
77
override protected def getTestProjectJdk : Sdk = SmartJDKLoader .getOrCreateJDK(testProjectJdkVersion)
76
78
79
+ protected def reuseCompileServerProcessBetweenTests : Boolean = true
80
+
77
81
override protected def setUpModule (): Unit = {
78
82
super .setUpModule()
79
83
EdtTestUtil .runInEdtAndWait { () =>
@@ -104,7 +108,17 @@ trait ScalaExecutionTestCase extends ExecutionTestCase with ScalaSdkOwner {
104
108
105
109
override protected def tearDown (): Unit = {
106
110
try {
107
- CompileServerLauncher .stopServerAndWait()
111
+ if (reuseCompileServerProcessBetweenTests) {
112
+ // noinspection ApiStatus,UnstableApiUsage
113
+ ThreadLeakTracker .longRunningThreadCreated(
114
+ ApplicationManager .getApplication,
115
+ " BaseDataReader: output stream of scalaCompileServer" ,
116
+ " BaseDataReader: error stream of scalaCompileServer" ,
117
+ " scalaCompileServer"
118
+ )
119
+ } else {
120
+ CompileServerLauncher .stopServerAndWait()
121
+ }
108
122
EdtTestUtil .runInEdtAndWait { () =>
109
123
disposeLibraries(getModule)
110
124
}
0 commit comments