Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(137)

Side by Side Diff: tools/testing/dart/test_runner.dart

Issue 691583002: Retry failing tests on Safari, because it is flaky. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2563 matching lines...) Expand 10 before | Expand all | Expand 10 after
2574 Future cleanup() => new Future.value(); 2574 Future cleanup() => new Future.value();
2575 2575
2576 Future<CommandOutput> runCommand(node, ProcessCommand command, int timeout) { 2576 Future<CommandOutput> runCommand(node, ProcessCommand command, int timeout) {
2577 assert(node.dependencies.length == 0); 2577 assert(node.dependencies.length == 0);
2578 return new Future.value(_archive.outputOf(command)); 2578 return new Future.value(_archive.outputOf(command));
2579 } 2579 }
2580 } 2580 }
2581 2581
2582 bool shouldRetryCommand(CommandOutput output) { 2582 bool shouldRetryCommand(CommandOutput output) {
2583 var command = output.command; 2583 var command = output.command;
2584 // We rerun tests on Safari because 6.2 and 7.1 are flaky. Issue 21434.
2585 if (command is BrowserTestCommand && command.browser == 'safari' &&
2586 output is BrowserControllerTestOutcome &&
2587 output._rawOutcome != Expectation.PASS) {
2588 // TODO(whesse): This retries tests that fail intentionally. Fix this
2589 return true;
2590 }
2584 2591
2585 if (!output.successful) { 2592 if (!output.successful) {
2586 List<String> stdout, stderr; 2593 List<String> stdout, stderr;
2587 2594
2588 decodeOutput() { 2595 decodeOutput() {
2589 if (stdout == null && stderr == null) { 2596 if (stdout == null && stderr == null) {
2590 stdout = decodeUtf8(output.stderr).split("\n"); 2597 stdout = decodeUtf8(output.stderr).split("\n");
2591 stderr = decodeUtf8(output.stderr).split("\n"); 2598 stderr = decodeUtf8(output.stderr).split("\n");
2592 } 2599 }
2593 } 2600 }
2594 2601
2595 if (io.Platform.operatingSystem == 'linux') { 2602 if (io.Platform.operatingSystem == 'linux') {
2596 decodeOutput(); 2603 decodeOutput();
2597 // No matter which command we ran: If we get failures due to the 2604 // No matter which command we ran: If we get failures due to the
2598 // "xvfb-run" issue 7564, try re-running the test. 2605 // "xvfb-run" issue 7564, try re-running the test.
2599 bool containsFailureMsg(String line) { 2606 bool containsFailureMsg(String line) {
2600 return line.contains(MESSAGE_CANNOT_OPEN_DISPLAY) || 2607 return line.contains(MESSAGE_CANNOT_OPEN_DISPLAY) ||
2601 line.contains(MESSAGE_FAILED_TO_RUN_COMMAND); 2608 line.contains(MESSAGE_FAILED_TO_RUN_COMMAND);
2602 } 2609 }
2603 if (stdout.any(containsFailureMsg) || stderr.any(containsFailureMsg)) { 2610 if (stdout.any(containsFailureMsg) || stderr.any(containsFailureMsg)) {
2604 return true; 2611 return true;
2605 } 2612 }
2606 } 2613 }
2607 2614
2608 // We currently rerun dartium tests, see issue 14074. 2615 // We currently rerun dartium tests, see issue 14074.
2609 // We rerun tests on Safari because 6.2 and 7.1 are flaky. Issue 21434. 2616 if (command is BrowserTestCommand && command.browser == 'dartium') {
2610 if (command is BrowserTestCommand &&
2611 (command.browser == 'dartium' || command.browser == 'safari')) {
2612 return true; 2617 return true;
2613 } 2618 }
2614 } 2619 }
2615 return false; 2620 return false;
2616 } 2621 }
2617 2622
2618 /* 2623 /*
2619 * [TestCaseCompleter] will listen for 2624 * [TestCaseCompleter] will listen for
2620 * NodeState.Processing -> NodeState.{Successful,Failed} state changes and 2625 * NodeState.Processing -> NodeState.{Successful,Failed} state changes and
2621 * will complete a TestCase if it is finished. 2626 * will complete a TestCase if it is finished.
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
2903 } 2908 }
2904 } 2909 }
2905 2910
2906 void eventAllTestsDone() { 2911 void eventAllTestsDone() {
2907 for (var listener in _eventListener) { 2912 for (var listener in _eventListener) {
2908 listener.allDone(); 2913 listener.allDone();
2909 } 2914 }
2910 _allDone(); 2915 _allDone();
2911 } 2916 }
2912 } 2917 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698