| 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 2616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2627 | 2627 |
| 2628 Future cleanup() => new Future.value(); | 2628 Future cleanup() => new Future.value(); |
| 2629 | 2629 |
| 2630 Future<CommandOutput> runCommand(node, ProcessCommand command, int timeout) { | 2630 Future<CommandOutput> runCommand(node, ProcessCommand command, int timeout) { |
| 2631 assert(node.dependencies.length == 0); | 2631 assert(node.dependencies.length == 0); |
| 2632 return new Future.value(_archive.outputOf(command)); | 2632 return new Future.value(_archive.outputOf(command)); |
| 2633 } | 2633 } |
| 2634 } | 2634 } |
| 2635 | 2635 |
| 2636 bool shouldRetryCommand(CommandOutput output) { | 2636 bool shouldRetryCommand(CommandOutput output) { |
| 2637 var command = output.command; | |
| 2638 // We rerun tests on Safari because 6.2 and 7.1 are flaky. Issue 21434. | |
| 2639 if (command is BrowserTestCommand && | |
| 2640 command.retry && | |
| 2641 command.browser == 'safari' && | |
| 2642 output is BrowserControllerTestOutcome && | |
| 2643 output._rawOutcome != Expectation.PASS) { | |
| 2644 return true; | |
| 2645 } | |
| 2646 | |
| 2647 if (!output.successful) { | 2637 if (!output.successful) { |
| 2648 List<String> stdout, stderr; | 2638 List<String> stdout, stderr; |
| 2649 | 2639 |
| 2650 decodeOutput() { | 2640 decodeOutput() { |
| 2651 if (stdout == null && stderr == null) { | 2641 if (stdout == null && stderr == null) { |
| 2652 stdout = decodeUtf8(output.stderr).split("\n"); | 2642 stdout = decodeUtf8(output.stderr).split("\n"); |
| 2653 stderr = decodeUtf8(output.stderr).split("\n"); | 2643 stderr = decodeUtf8(output.stderr).split("\n"); |
| 2654 } | 2644 } |
| 2655 } | 2645 } |
| 2656 | 2646 |
| 2657 if (io.Platform.operatingSystem == 'linux') { | 2647 if (io.Platform.operatingSystem == 'linux') { |
| 2658 decodeOutput(); | 2648 decodeOutput(); |
| 2659 // No matter which command we ran: If we get failures due to the | 2649 // No matter which command we ran: If we get failures due to the |
| 2660 // "xvfb-run" issue 7564, try re-running the test. | 2650 // "xvfb-run" issue 7564, try re-running the test. |
| 2661 bool containsFailureMsg(String line) { | 2651 bool containsFailureMsg(String line) { |
| 2662 return line.contains(MESSAGE_CANNOT_OPEN_DISPLAY) || | 2652 return line.contains(MESSAGE_CANNOT_OPEN_DISPLAY) || |
| 2663 line.contains(MESSAGE_FAILED_TO_RUN_COMMAND); | 2653 line.contains(MESSAGE_FAILED_TO_RUN_COMMAND); |
| 2664 } | 2654 } |
| 2665 if (stdout.any(containsFailureMsg) || stderr.any(containsFailureMsg)) { | 2655 if (stdout.any(containsFailureMsg) || stderr.any(containsFailureMsg)) { |
| 2666 return true; | 2656 return true; |
| 2667 } | 2657 } |
| 2668 } | 2658 } |
| 2669 | 2659 |
| 2670 // We currently rerun dartium tests, see issue 14074. | 2660 // We currently rerun dartium tests, see issue 14074. |
| 2661 final command = output.command; |
| 2671 if (command is BrowserTestCommand && | 2662 if (command is BrowserTestCommand && |
| 2672 command.retry && | 2663 command.retry && |
| 2673 command.browser == 'dartium') { | 2664 command.browser == 'dartium') { |
| 2674 return true; | 2665 return true; |
| 2675 } | 2666 } |
| 2676 } | 2667 } |
| 2677 return false; | 2668 return false; |
| 2678 } | 2669 } |
| 2679 | 2670 |
| 2680 /* | 2671 /* |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2966 } | 2957 } |
| 2967 } | 2958 } |
| 2968 | 2959 |
| 2969 void eventAllTestsDone() { | 2960 void eventAllTestsDone() { |
| 2970 for (var listener in _eventListener) { | 2961 for (var listener in _eventListener) { |
| 2971 listener.allDone(); | 2962 listener.allDone(); |
| 2972 } | 2963 } |
| 2973 _allDone(); | 2964 _allDone(); |
| 2974 } | 2965 } |
| 2975 } | 2966 } |
| OLD | NEW |