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

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

Issue 11189150: Don't replicate timeout calculation for browser tests. They do their own timing (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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
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 592 matching lines...) Expand 10 before | Expand all | Expand 10 after
603 /** 603 /**
604 * Process exit handler called at the end of every command. It internally 604 * Process exit handler called at the end of every command. It internally
605 * treats all but the last command as compilation steps. The last command is 605 * treats all but the last command as compilation steps. The last command is
606 * the actual test and its output is analyzed in [testComplete]. 606 * the actual test and its output is analyzed in [testComplete].
607 */ 607 */
608 void stepExitHandler(int exitCode) { 608 void stepExitHandler(int exitCode) {
609 process.close(); 609 process.close();
610 process = null; 610 process = null;
611 int totalSteps = testCase.commands.length; 611 int totalSteps = testCase.commands.length;
612 String suffix =' (step $currentStep of $totalSteps)'; 612 String suffix =' (step $currentStep of $totalSteps)';
613 if (timedOut) { 613 if (timedOut &&
614 // Test timed out before it could complete. 614 !(testCase.usesWebDriver && !testCase.configuration['noBatch'])) {
Jennifer Messerly 2012/10/23 22:50:19 might want to add a property for: testCase.us
Emily Fortuna 2012/10/23 23:11:25 But the dartc tests also "usesBatchRunner"...
Mads Ager (google) 2012/10/24 05:56:14 I don't understand why this should change. If we a
Mads Ager (google) 2012/10/24 12:03:47 Something is completely off here. I don't see how
615 // Non-webdriver test timed out before it could complete. Webdriver tests
616 // run their own timeouts by timing from the launch of the browser (which
617 // could be delayed).
615 testComplete(0, true); 618 testComplete(0, true);
616 } else if (currentStep == totalSteps) { 619 } else if (currentStep == totalSteps) {
617 // Done with all test commands. 620 // Done with all test commands.
618 testComplete(exitCode, false); 621 testComplete(exitCode, false);
619 } else if (exitCode != 0) { 622 } else if (exitCode != 0) {
620 // One of the steps failed. 623 // One of the steps failed.
621 stderr.add('test.dart: Compilation failed$suffix, exit code $exitCode\n'); 624 stderr.add('test.dart: Compilation failed$suffix, exit code $exitCode\n');
622 testComplete(exitCode, true); 625 testComplete(exitCode, true);
623 } else { 626 } else {
624 // One compilation step successfully completed, move on to the 627 // One compilation step successfully completed, move on to the
625 // next step. 628 // next step.
626 stderr.add('test.dart: Compilation finished $suffix\n'); 629 stderr.add('test.dart: Compilation finished $suffix\n');
627 stdout.add('test.dart: Compilation finished $suffix\n'); 630 stdout.add('test.dart: Compilation finished $suffix\n');
628 if (currentStep == totalSteps - 1 && testCase.usesWebDriver && 631 if (currentStep == totalSteps - 1 && testCase.usesWebDriver &&
629 !testCase.configuration['noBatch']) { 632 !testCase.configuration['noBatch']) {
630 // Note: processQueue will always be non-null for runtime == ie9, ie10, 633 // Note: processQueue will always be non-null for runtime == ie9, ie10,
631 // ff, safari, chrome, opera. (It is only null for runtime == vm) 634 // ff, safari, chrome, opera. (It is only null for runtime == vm)
632 // This RunningProcess object is done, and hands over control to 635 // This RunningProcess object is done, and hands over control to
633 // BatchRunner.startTest(), which handles reporting, etc. 636 // BatchRunner.startTest(), which handles reporting, etc.
634 timeoutTimer.cancel(); 637 timeoutTimer.cancel();
Mads Ager (google) 2012/10/24 05:56:14 Here we cancel the timer before starting the brows
635 processQueue._getBatchRunner(testCase).startTest(testCase); 638 processQueue._getBatchRunner(testCase).startTest(testCase);
636 } else { 639 } else {
637 runCommand(testCase.commands[currentStep++], stepExitHandler); 640 runCommand(testCase.commands[currentStep++], stepExitHandler);
638 } 641 }
639 } 642 }
640 } 643 }
641 644
642 VoidFunction makeReadHandler(StringInputStream source, 645 VoidFunction makeReadHandler(StringInputStream source,
643 List<String> destination) { 646 List<String> destination) {
644 void handler () { 647 void handler () {
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after
1281 // the developer doesn't waste his or her time trying to fix a bunch of 1284 // the developer doesn't waste his or her time trying to fix a bunch of
1282 // tests that appear to be broken but were actually just flakes that 1285 // tests that appear to be broken but were actually just flakes that
1283 // didn't get retried because there had already been one failure. 1286 // didn't get retried because there had already been one failure.
1284 bool allowRetry = _MAX_FAILED_NO_RETRY > _progress.numFailedTests; 1287 bool allowRetry = _MAX_FAILED_NO_RETRY > _progress.numFailedTests;
1285 new RunningProcess(test, allowRetry, this).start(); 1288 new RunningProcess(test, allowRetry, this).start();
1286 } 1289 }
1287 _numProcesses++; 1290 _numProcesses++;
1288 } 1291 }
1289 } 1292 }
1290 } 1293 }
OLDNEW
« tools/testing/dart/test_options.dart ('K') | « tools/testing/dart/test_options.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698