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

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

Issue 10448048: Revert "Add some temporary code to work around an error in test scripts, to fix buildbots." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 6 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 712 matching lines...) Expand 10 before | Expand all | Expand 10 after
723 _timer = new Timer(testCase.timeout * 1000, _timeoutHandler); 723 _timer = new Timer(testCase.timeout * 1000, _timeoutHandler);
724 var line = _createArgumentsLine(testCase.batchTestArguments); 724 var line = _createArgumentsLine(testCase.batchTestArguments);
725 _process.stdin.write(line.charCodes()); 725 _process.stdin.write(line.charCodes());
726 } 726 }
727 727
728 String _createArgumentsLine(List<String> arguments) { 728 String _createArgumentsLine(List<String> arguments) {
729 return Strings.join(arguments, ' ').concat('\n'); 729 return Strings.join(arguments, ' ').concat('\n');
730 } 730 }
731 731
732 void _testCompleted() { 732 void _testCompleted() {
733 // TODO(3286): Remove this temporary code used to diagnose problem.
734 if (!_stdoutDrained || !_stderrDrained) {
735 print("Warning: Batch Test Runner problem:\n"
736 " _stdoutDrained: $_stdoutDrained, _stderrDrained: $_stderrDrained");
737 }
738 var test = _currentTest; 733 var test = _currentTest;
739 _currentTest = null; 734 _currentTest = null;
740 test.completed(); 735 test.completed();
741 } 736 }
742 737
743 int _reportResult(String output) { 738 int _reportResult(String output) {
744 _stdoutDrained = true; 739 _stdoutDrained = true;
745 // output = '>>> TEST {PASS, FAIL, OK, CRASH, FAIL, TIMEOUT}' 740 // output = '>>> TEST {PASS, FAIL, OK, CRASH, FAIL, TIMEOUT}'
746 var outcome = output.split(" ")[2]; 741 var outcome = output.split(" ")[2];
747 var exitCode = 0; 742 var exitCode = 0;
748 if (outcome == "CRASH") exitCode = -10; 743 if (outcome == "CRASH") exitCode = -10;
749 if (outcome == "FAIL" || outcome == "TIMEOUT") exitCode = 1; 744 if (outcome == "FAIL" || outcome == "TIMEOUT") exitCode = 1;
750 // TODO(3286): Remove this temporary code used to diagnose problem. 745 new TestOutput.fromCase(_currentTest, exitCode, (outcome == "TIMEOUT"),
751 if (_currentTest == null) { 746 _testStdout, _testStderr,
752 print("Warning: Batch Test Runner problem:\n" 747 new Date.now().difference(_startTime));
753 " _currentTest is null\n"
754 " Stdout:");
755 for (var line in _testStdout) {
756 print(line);
757 }
758 print(" Stderr:");
759 for (var line in _testStderr) {
760 print(line);
761 }
762 } else {
763 new TestOutput.fromCase(_currentTest, exitCode, (outcome == "TIMEOUT"),
764 _testStdout, _testStderr,
765 new Date.now().difference(_startTime));
766 }
767 // Move on when both stdout and stderr has been drained. If the test 748 // Move on when both stdout and stderr has been drained. If the test
768 // crashed, we restarted the process and therefore do not attempt to 749 // crashed, we restarted the process and therefore do not attempt to
769 // drain stderr. 750 // drain stderr.
770 if (_stderrDrained || (_currentTest.output.hasCrashed)) _testCompleted(); 751 if (_stderrDrained || (_currentTest.output.hasCrashed)) _testCompleted();
771 } 752 }
772 753
773 void _stderrDone() { 754 void _stderrDone() {
774 _stderrDrained = true; 755 _stderrDrained = true;
775 // Move on when both stdout and stderr has been drained. 756 // Move on when both stdout and stderr has been drained.
776 if (_stdoutDrained) _testCompleted(); 757 if (_stdoutDrained) _testCompleted();
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
1155 // the developer doesn't waste his or her time trying to fix a bunch of 1136 // the developer doesn't waste his or her time trying to fix a bunch of
1156 // tests that appear to be broken but were actually just flakes that 1137 // tests that appear to be broken but were actually just flakes that
1157 // didn't get retried because there had already been one failure. 1138 // didn't get retried because there had already been one failure.
1158 bool allowRetry = _MAX_FAILED_NO_RETRY > _progress.numFailedTests; 1139 bool allowRetry = _MAX_FAILED_NO_RETRY > _progress.numFailedTests;
1159 new RunningProcess(test, allowRetry, this).start(); 1140 new RunningProcess(test, allowRetry, this).start();
1160 } 1141 }
1161 _numProcesses++; 1142 _numProcesses++;
1162 } 1143 }
1163 } 1144 }
1164 } 1145 }
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