Skip to content

Commit 73aaea3

Browse files
committed
[tests, debugger, testing support] Reuse the Scala Compile Server when running debugger and testing support tests
1 parent 58d7c50 commit 73aaea3

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

scala/compiler-integration/test/org/jetbrains/plugins/scala/compiler/ScalaExecutionTestCase.scala

+15-1
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@ package org.jetbrains.plugins.scala.compiler
33
import com.intellij.debugger.impl.OutputChecker
44
import com.intellij.execution.ExecutionTestCase
55
import com.intellij.execution.configurations.JavaParameters
6+
import com.intellij.openapi.application.ApplicationManager
67
import com.intellij.openapi.diagnostic.Logger
78
import com.intellij.openapi.projectRoots.Sdk
89
import com.intellij.openapi.vfs.LocalFileSystem
910
import com.intellij.pom.java.LanguageLevel
1011
import com.intellij.testFramework.EdtTestUtil
12+
import com.intellij.testFramework.common.ThreadLeakTracker
1113
import org.jetbrains.plugins.scala.base.libraryLoaders.{HeavyJDKLoader, LibraryLoader, ScalaSDKLoader, SmartJDKLoader}
1214
import org.jetbrains.plugins.scala.base.{ScalaSdkOwner, SourceRootTestUtil}
1315
import org.jetbrains.plugins.scala.extensions.PathExt
@@ -74,6 +76,8 @@ trait ScalaExecutionTestCase extends ExecutionTestCase with ScalaSdkOwner {
7476

7577
override protected def getTestProjectJdk: Sdk = SmartJDKLoader.getOrCreateJDK(testProjectJdkVersion)
7678

79+
protected def reuseCompileServerProcessBetweenTests: Boolean = true
80+
7781
override protected def setUpModule(): Unit = {
7882
super.setUpModule()
7983
EdtTestUtil.runInEdtAndWait { () =>
@@ -104,7 +108,17 @@ trait ScalaExecutionTestCase extends ExecutionTestCase with ScalaSdkOwner {
104108

105109
override protected def tearDown(): Unit = {
106110
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+
}
108122
EdtTestUtil.runInEdtAndWait { () =>
109123
disposeLibraries(getModule)
110124
}

0 commit comments

Comments
 (0)