| Index: tools/testing/dart/test_runner.dart
|
| diff --git a/tools/testing/dart/test_runner.dart b/tools/testing/dart/test_runner.dart
|
| index 2615303f8fe9a52d4ef85abf05666564610d772c..1eeb00e8268906b3b80c9393f8934e3f6068534e 100644
|
| --- a/tools/testing/dart/test_runner.dart
|
| +++ b/tools/testing/dart/test_runner.dart
|
| @@ -506,6 +506,8 @@ class RunningProcess {
|
| /** Which command of [testCase.commands] is currently being executed. */
|
| int currentStep;
|
|
|
| + static final int kErrorStartingProcess = -171717; // Chosen arbitrarily.
|
| +
|
| RunningProcess(TestCase this.testCase,
|
| [this.allowRetries = false, this.processQueue]);
|
|
|
| @@ -600,6 +602,7 @@ class RunningProcess {
|
| }
|
| process = new Process.start(command.executable, command.arguments);
|
| process.onExit = exitHandler;
|
| + process.onError = (error) { exitHandler(kErrorStartingProcess); };
|
| startTime = new Date.now();
|
| InputStream stdoutStream = process.stdout;
|
| InputStream stderrStream = process.stderr;
|
| @@ -609,7 +612,10 @@ class RunningProcess {
|
| makeReadHandler(stdoutStringStream, stdout);
|
| stderrStringStream.onLine =
|
| makeReadHandler(stderrStringStream, stderr);
|
| - timeoutTimer = new Timer(1000 * testCase.timeout, timeoutHandler);
|
| + if (timeoutTimer == null) {
|
| + // Create one timeout timer when starting test case, remove it at end.
|
| + timeoutTimer = new Timer(1000 * testCase.timeout, timeoutHandler);
|
| + }
|
| }
|
|
|
| void timeoutHandler(Timer unusedTimer) {
|
| @@ -1101,8 +1107,9 @@ class ProcessQueue {
|
| }
|
| if (test.usesWebDriver && _needsSelenium && !_isSeleniumAvailable) {
|
| // The server is not ready to run Selenium tests. Put the test back in
|
| - // the queue.
|
| - _tests.addFirst(test);
|
| + // the queue. Avoid spin-polling by using a timeout.
|
| + _tests.add(test);
|
| + new Timer(1000, (timer) {_tryRunTest();}); // Don't lose a process.
|
| return;
|
| }
|
| if (_verbose) {
|
|
|