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

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

Issue 12086048: Bugfix in test_runner: in certain cases tests did not get rerun (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 months 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 1706 matching lines...) Expand 10 before | Expand all | Expand 10 after
1717 var nextCommandIndex = testCase.commandOutputs.keys.length; 1717 var nextCommandIndex = testCase.commandOutputs.keys.length;
1718 var numberOfCommands = testCase.commands.length; 1718 var numberOfCommands = testCase.commands.length;
1719 Expect.isTrue(nextCommandIndex < numberOfCommands); 1719 Expect.isTrue(nextCommandIndex < numberOfCommands);
1720 var command = testCase.commands[nextCommandIndex]; 1720 var command = testCase.commands[nextCommandIndex];
1721 var isLastCommand = nextCommandIndex == (numberOfCommands - 1); 1721 var isLastCommand = nextCommandIndex == (numberOfCommands - 1);
1722 1722
1723 void runCommand() { 1723 void runCommand() {
1724 var runningProcess = new RunningProcess(testCase, command); 1724 var runningProcess = new RunningProcess(testCase, command);
1725 runningProcess.start().then((CommandOutput commandOutput) { 1725 runningProcess.start().then((CommandOutput commandOutput) {
1726 if (isLastCommand) { 1726 if (isLastCommand) {
1727 // NOTE: We need to call commandOutput.unexpectedOutput here.
1728 // Calling this getter may result in the side-effect, that
1729 // commandOutput.requestRetry is set to true.
1730 // (BrowserCommandOutputImpl._failedBecauseOfMissingXDisplay
1731 // does that for example)
1732 // TODO(ricow/kustermann): Issue 8206
1733 var unexpectedOutput = commandOutput.unexpectedOutput;
1727 if (allowRetry && testCase.usesWebDriver 1734 if (allowRetry && testCase.usesWebDriver
1728 && commandOutput.unexpectedOutput 1735 && unexpectedOutput
1729 && (testCase as BrowserTestCase).numRetries > 0) { 1736 && (testCase as BrowserTestCase).numRetries > 0) {
1730 // Selenium tests can be flaky. Try rerunning. 1737 // Selenium tests can be flaky. Try rerunning.
1731 commandOutput.requestRetry = true; 1738 commandOutput.requestRetry = true;
1732 } 1739 }
1733 } 1740 }
1734 if (commandOutput.requestRetry) { 1741 if (commandOutput.requestRetry) {
1735 commandOutput.requestRetry = false; 1742 commandOutput.requestRetry = false;
1736 (testCase as BrowserTestCase).numRetries--; 1743 (testCase as BrowserTestCase).numRetries--;
1737 DebugLogger.warning("Rerunning Test: ${testCase.displayName} " 1744 DebugLogger.warning("Rerunning Test: ${testCase.displayName} "
1738 "(${(testCase as BrowserTestCase).numRetries} " 1745 "(${(testCase as BrowserTestCase).numRetries} "
1739 "attempt(s) remains) [cmd:$command]"); 1746 "attempt(s) remains) [cmd:$command]");
1740 runCommand(); 1747 runCommand();
1741 } else { 1748 } else {
1742 completer.complete(testCase); 1749 completer.complete(testCase);
1743 } 1750 }
1744 }); 1751 });
1745 } 1752 }
1746 runCommand(); 1753 runCommand();
1747 1754
1748 return completer.future; 1755 return completer.future;
1749 } 1756 }
1750 } 1757 }
1751 1758
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