mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Tests: always shut down async evaluation service in tests
This commit is contained in:
@@ -6,6 +6,7 @@ import com.intellij.openapi.project.Project;
|
||||
import com.intellij.util.ConcurrencyUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.annotations.TestOnly;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -72,4 +73,11 @@ public final class PyDebugValueExecutionService {
|
||||
myAsyncValuesExecutorService = null;
|
||||
}
|
||||
}
|
||||
|
||||
@TestOnly
|
||||
public synchronized void shutDownNow() {
|
||||
if (myAsyncValuesExecutorService != null) {
|
||||
myAsyncValuesExecutorService.shutdownNow();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -305,7 +305,7 @@ public class PyConsoleTask extends PyExecutionFixtureTestTask {
|
||||
if (count > 10) {
|
||||
Assert.fail("Console is not ready");
|
||||
}
|
||||
Thread.sleep(300);
|
||||
Thread.sleep(2000);
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ import com.intellij.xdebugger.*;
|
||||
import com.jetbrains.env.python.PythonDebuggerTest;
|
||||
import com.jetbrains.python.debugger.PyDebugProcess;
|
||||
import com.jetbrains.python.debugger.PyDebugRunner;
|
||||
import com.jetbrains.python.debugger.PyDebugValueExecutionService;
|
||||
import com.jetbrains.python.run.PythonCommandLineState;
|
||||
import com.jetbrains.python.run.PythonConfigurationType;
|
||||
import com.jetbrains.python.run.PythonRunConfiguration;
|
||||
@@ -233,6 +234,8 @@ public class PyDebuggerTask extends PyBaseDebuggerTask {
|
||||
waitFor(processHandler);
|
||||
}
|
||||
|
||||
PyDebugValueExecutionService.getInstance(getProject()).shutDownNow();
|
||||
|
||||
if (!processHandler.isProcessTerminated()) {
|
||||
killDebugProcess();
|
||||
if (!waitFor(processHandler)) {
|
||||
|
||||
Reference in New Issue
Block a user