Index: tools/testing/dart/test_runner.dart |
diff --git a/tools/testing/dart/test_runner.dart b/tools/testing/dart/test_runner.dart |
index 51bcde6941576a4525d41bdfcc2f9cbf098e4856..9df2b2565a7be6a9bf286a40a42e735259a694f8 100644 |
--- a/tools/testing/dart/test_runner.dart |
+++ b/tools/testing/dart/test_runner.dart |
@@ -364,25 +364,14 @@ class AnalysisCommand extends ProcessCommand { |
} |
class VmCommand extends ProcessCommand { |
- final bool needsDFERunner; |
VmCommand._(String executable, List<String> arguments, |
- Map<String, String> environmentOverrides, |
- bool this.needsDFERunner) |
+ Map<String, String> environmentOverrides) |
: super._("vm", executable, arguments, environmentOverrides); |
- |
- void _buildHashCode(HashCodeBuilder builder) { |
- super._buildHashCode(builder); |
- builder.add(needsDFERunner); |
- } |
- |
- bool _equal(VmCommand other) => |
- super._equal(other) && needsDFERunner == other.needsDFERunner; |
} |
class VmBatchCommand extends ProcessCommand implements VmCommand { |
final String dartFile; |
final bool checked; |
- final needsDFERunner = false; |
VmBatchCommand._(String executable, String dartFile, List<String> arguments, |
Map<String, String> environmentOverrides, {this.checked: true}) |
@@ -651,8 +640,8 @@ class CommandBuilder { |
} |
VmCommand getVmCommand(String executable, List<String> arguments, |
- Map<String, String> environmentOverrides, {bool needsDFERunner: false}) { |
- var command = new VmCommand._(executable, arguments, environmentOverrides, needsDFERunner); |
+ Map<String, String> environmentOverrides) { |
+ var command = new VmCommand._(executable, arguments, environmentOverrides); |
return _getUniqueCommand(command); |
} |
@@ -1901,12 +1890,10 @@ class RunningProcess { |
bool compilationSkipped = false; |
Completer<CommandOutput> completer; |
Map configuration; |
- List<String> preArguments; |
RunningProcess(this.command, |
this.timeout, |
- {this.configuration, |
- this.preArguments}); |
+ {this.configuration}); |
Future<CommandOutput> run() { |
completer = new Completer<CommandOutput>(); |
@@ -1923,9 +1910,6 @@ class RunningProcess { |
} else { |
var processEnvironment = _createProcessEnvironment(); |
var args = command.arguments; |
- if (preArguments != null) { |
- args = []..addAll(preArguments)..addAll(args); |
- } |
Future processFuture = io.Process.start( |
command.executable, args, |
environment: processEnvironment, |
@@ -2333,102 +2317,6 @@ class BatchRunnerProcess { |
} |
} |
-class BatchDFEProcess { |
- io.Process _process; |
- int _port = -1; |
- Function _processExitHandler; |
- |
- Completer terminating = null; |
- |
- bool locked = false; |
- |
- Future<int> acquire() async { |
- try { |
- assert(!locked); |
- locked = true; |
- if (_process == null) { |
- await _startProcess(); |
- } |
- return _port; |
- } catch(e) { |
- locked = false; |
- rethrow; |
- } |
- } |
- |
- void release() { |
- locked = false; |
- } |
- |
- Future terminate() { |
- locked = true; |
- if (_process == null) { |
- return new Future.value(true); |
- } |
- if (terminating == null) { |
- terminating = new Completer(); |
- _process.kill(); |
- } |
- return terminating.future; |
- } |
- |
- _onExit(exitCode) { |
- if (terminating != null) { |
- terminating.complete(); |
- return; |
- } |
- |
- _process = null; |
- locked = false; |
- _port = -1; |
- } |
- |
- static Future<String> _firstLine(stream) { |
- var completer = new Completer<String>(); |
- stream.transform(UTF8.decoder) |
- .transform(new LineSplitter()) |
- .listen((line) { |
- if (!completer.isCompleted) { |
- completer.complete(line); |
- } |
- // We need to drain a pipe continuously. |
- }, onDone: () { |
- if (!completer.isCompleted) { |
- completer.completeError( |
- "DFE kernel compiler server did not sucessfully start up"); |
- } |
- }); |
- return completer.future; |
- } |
- |
- Future _startProcess() async { |
- final executable = io.Platform.executable; |
- final arguments = ['utils/kernel-service/kernel-service.dart', '--batch']; |
- |
- try { |
- _port = -1; |
- _process = await io.Process.start(executable, arguments); |
- _process.exitCode.then(_onExit); |
- _process.stderr.transform(UTF8.decoder).listen(DebugLogger.error); |
- |
- final readyMsg = await _firstLine(_process.stdout); |
- final data = readyMsg.split(' '); |
- assert(data[0] == 'READY'); |
- |
- _port = int.parse(data[1]); |
- } catch (e) { |
- print("Process error:"); |
- print(" Command: $executable ${arguments.join(' ')}"); |
- print(" Error: $e"); |
- // If there is an error starting a batch process, chances are that |
- // it will always fail. So rather than re-trying a 1000+ times, we |
- // exit. |
- io.exit(1); |
- return true; |
- } |
- } |
-} |
- |
/** |
* [TestCaseEnqueuer] takes a list of TestSuites, generates TestCases and |
* builds a dependency graph of all commands in every TestSuite. |
@@ -2737,8 +2625,6 @@ class CommandExecutorImpl implements CommandExecutor { |
// We keep a BrowserTestRunner for every configuration. |
final _browserTestRunners = new Map<Map, BrowserTestRunner>(); |
- List<BatchDFEProcess> _dfeProcesses = null; |
- |
bool _finishing = false; |
CommandExecutorImpl( |
@@ -2763,13 +2649,9 @@ class CommandExecutorImpl implements CommandExecutor { |
return Future.wait(futures); |
} |
- Future _terminateDFEWorkers() => |
- Future.wait((_dfeProcesses ?? <BatchDFEProcess>[]).map((p) => p.terminate())); |
- |
return Future.wait([ |
_terminateBatchRunners(), |
_terminateBrowserRunners(), |
- _terminateDFEWorkers() |
]); |
} |
@@ -2818,13 +2700,6 @@ class CommandExecutorImpl implements CommandExecutor { |
adbDevicePool.releaseDevice(device); |
}); |
}); |
- } else if (command is VmCommand && command.needsDFERunner) { |
- final runner = _getDFEProcess(); |
- return runner.acquire().then((port) { |
- return new RunningProcess(command, timeout, |
- configuration: globalConfiguration, |
- preArguments: ['-DDFE_WORKER_PORT=${port}']).run(); |
- }).whenComplete(() => runner.release()); |
} else if (command is VmBatchCommand) { |
var name = command.displayName; |
return _getBatchRunner(command.displayName + command.dartFile) |
@@ -2928,12 +2803,6 @@ class CommandExecutorImpl implements CommandExecutor { |
throw new Exception('Unable to find inactive batch runner.'); |
} |
- BatchDFEProcess _getDFEProcess() { |
- _dfeProcesses ??= new List<BatchDFEProcess>.generate(maxProcesses, |
- (_) => new BatchDFEProcess()); |
- return _dfeProcesses.firstWhere((runner) => !runner.locked); |
- } |
- |
Future<CommandOutput> _startBrowserControllerTest( |
BrowserTestCommand browserCommand, int timeout) { |
var completer = new Completer<CommandOutput>(); |