Chromium Code Reviews| Index: tools/testing/dart/test_runner.dart |
| =================================================================== |
| --- tools/testing/dart/test_runner.dart (revision 4362) |
| +++ tools/testing/dart/test_runner.dart (working copy) |
| @@ -200,16 +200,6 @@ |
| if (testCase is !BrowserTestCase) return (exitCode != 0 && !hasCrashed); |
| // Browser case: |
| - // Browser tests fail unless stdout contains |
| - // 'Content-Type: text/plain\nPASS'. |
| - String previous_line = ''; |
| - for (String line in stdout) { |
| - if (line == 'PASS' && previous_line == 'Content-Type: text/plain') { |
| - return (exitCode != 0 && !hasCrashed); |
|
Emily Fortuna
2012/02/17 19:34:24
Sometimes when DRT crashes with a memory dump, and
Siggi Cherem (dart-lang)
2012/02/17 19:51:38
I thought in that case we wouldn't have PASS in th
Emily Fortuna
2012/02/17 21:03:03
Sometimes it does, and sometimes it doesn't when D
|
| - } |
| - previous_line = line; |
| - } |
| - |
| // If the browser test failed, it may have been because DumpRenderTree |
| // and the virtual framebuffer X server didn't hook up, or DRT crashed with |
| // a core dump. |
| @@ -222,6 +212,17 @@ |
| return true; |
| } |
| } |
| + |
| + // Browser tests fail unless stdout contains |
| + // 'Content-Type: text/plain\nPASS'. |
| + String previous_line = ''; |
| + for (String line in stdout) { |
| + if (line == 'PASS' && previous_line == 'Content-Type: text/plain') { |
| + return (exitCode != 0 && !hasCrashed); |
| + } |
| + previous_line = line; |
| + } |
| + |
| return true; |
| } |
| @@ -248,8 +249,9 @@ |
| List<String> stdout; |
| List<String> stderr; |
| List<Function> handlers; |
| + bool allowRetries; |
| - RunningProcess(TestCase this.testCase); |
| + RunningProcess(TestCase this.testCase, bool this.allowRetries); |
|
Siggi Cherem (dart-lang)
2012/02/17 19:51:38
I think when using this.xxx our style is to omit t
Emily Fortuna
2012/02/17 21:03:03
Done.
|
| void exitHandler(int exitCode) { |
| new TestOutput(testCase, exitCode, timedOut, stdout, |
| @@ -261,7 +263,7 @@ |
| for (var line in testCase.output.stderr) print(line); |
| for (var line in testCase.output.stdout) print(line); |
| } |
| - if (testCase.configuration['component'] == 'webdriver' && |
| + if (allowRetries && testCase.configuration['component'] == 'webdriver' && |
| testCase.output.unexpectedOutput && testCase.numRetries > 0) { |
| // Selenium tests can be flaky. Try rerunning. |
| testCase.output.requestRetry = true; |
| @@ -704,7 +706,11 @@ |
| _ensureDartcBatchRunnersStarted(test.executablePath); |
| _getDartcBatchRunnerProcess().startTest(test); |
| } else { |
| - new RunningProcess(test).start(); |
| + // If we've failed more than four tests, a lot of tests are likely |
|
Siggi Cherem (dart-lang)
2012/02/17 19:51:38
When is numFailedTest incremented?
I thought that
Emily Fortuna
2012/02/17 21:03:03
The progress counter keeps track of the *actual* f
Emily Fortuna
2012/02/17 21:04:45
*Edit to last paragraph:
Yes, numFailedTests is n
|
| + // broken. Don't continue to retry running tests if our tree is already |
| + // red. At this point rerunning to test for flakes takes more time than |
| + // it's worth. |
| + new RunningProcess(test, _progress.numFailedTests < 5).start(); |
|
Emily Fortuna
2012/02/17 19:34:24
Magic number... no me gusta :-(
Siggi Cherem (dart-lang)
2012/02/17 19:51:38
maybe we can do != 0?
|
| } |
| _numProcesses++; |
| } |