Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * Classes and methods for executing tests. | 6 * Classes and methods for executing tests. |
| 7 * | 7 * |
| 8 * This module includes: | 8 * This module includes: |
| 9 * - Managing parallel execution of tests, including timeout checks. | 9 * - Managing parallel execution of tests, including timeout checks. |
| 10 * - Evaluating the output of each test as pass/fail/crash/timeout. | 10 * - Evaluating the output of each test as pass/fail/crash/timeout. |
| (...skipping 736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 747 } | 747 } |
| 748 } | 748 } |
| 749 | 749 |
| 750 Future terminate() { | 750 Future terminate() { |
| 751 if (_process == null) return new Future.immediate(true); | 751 if (_process == null) return new Future.immediate(true); |
| 752 Completer completer = new Completer(); | 752 Completer completer = new Completer(); |
| 753 _process.onExit = (exitCode) { | 753 _process.onExit = (exitCode) { |
| 754 _process.close(); | 754 _process.close(); |
| 755 completer.complete(true); | 755 completer.complete(true); |
| 756 }; | 756 }; |
| 757 _process.kill(); | 757 if (_isWebDriver && Platform.operatingSystem == 'windows') { |
| 758 // Use a graceful shutdown so our Selenium script can close | |
| 759 // the open browser processes. TODO(jmesserly): Send a signal once | |
| 760 // that's supported in Windows. | |
| 761 _process.stdin.write('--terminate\n'.charCodes()); | |
| 762 | |
| 763 // In case the run_selenium process didn't close, kill it after 30s | |
| 764 int shutdownMillisecs = 30000; | |
| 765 new Timer(shutdownMillisecs, (e) { if (!closed) _process.kill(); }); | |
|
Mads Ager (google)
2012/10/09 06:16:57
Please don't do this. If you add a 30 sec timeout
| |
| 766 } else { | |
| 767 _process.kill(); | |
| 768 } | |
| 769 | |
| 758 return completer.future; | 770 return completer.future; |
| 759 } | 771 } |
| 760 | 772 |
| 761 void doStartTest(TestCase testCase) { | 773 void doStartTest(TestCase testCase) { |
| 762 _startTime = new Date.now(); | 774 _startTime = new Date.now(); |
| 763 _testStdout = []; | 775 _testStdout = []; |
| 764 _testStderr = []; | 776 _testStderr = []; |
| 765 _status = null; | 777 _status = null; |
| 766 _stdoutDrained = false; | 778 _stdoutDrained = false; |
| 767 _stderrDrained = false; | 779 _stderrDrained = false; |
| (...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1233 // the developer doesn't waste his or her time trying to fix a bunch of | 1245 // the developer doesn't waste his or her time trying to fix a bunch of |
| 1234 // tests that appear to be broken but were actually just flakes that | 1246 // tests that appear to be broken but were actually just flakes that |
| 1235 // didn't get retried because there had already been one failure. | 1247 // didn't get retried because there had already been one failure. |
| 1236 bool allowRetry = _MAX_FAILED_NO_RETRY > _progress.numFailedTests; | 1248 bool allowRetry = _MAX_FAILED_NO_RETRY > _progress.numFailedTests; |
| 1237 new RunningProcess(test, allowRetry, this).start(); | 1249 new RunningProcess(test, allowRetry, this).start(); |
| 1238 } | 1250 } |
| 1239 _numProcesses++; | 1251 _numProcesses++; |
| 1240 } | 1252 } |
| 1241 } | 1253 } |
| 1242 } | 1254 } |
| OLD | NEW |