OLD | NEW |
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 import 'dart:convert'; | 5 import 'dart:convert'; |
6 // We need to use the 'io' prefix here, otherwise io.exitCode will shadow | 6 // We need to use the 'io' prefix here, otherwise io.exitCode will shadow |
7 // CommandOutput.exitCode in subclasses of CommandOutput. | 7 // CommandOutput.exitCode in subclasses of CommandOutput. |
8 import 'dart:io' as io; | 8 import 'dart:io' as io; |
9 | 9 |
10 import 'browser_controller.dart'; | 10 import 'browser_controller.dart'; |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 if (outcome == Expectation.ignore) return outcome; | 98 if (outcome == Expectation.ignore) return outcome; |
99 if (outcome.canBeOutcomeOf(Expectation.fail)) { | 99 if (outcome.canBeOutcomeOf(Expectation.fail)) { |
100 return Expectation.pass; | 100 return Expectation.pass; |
101 } | 101 } |
102 return Expectation.fail; | 102 return Expectation.fail; |
103 } | 103 } |
104 } | 104 } |
105 | 105 |
106 class ContentShellCommandOutput extends CommandOutput { | 106 class ContentShellCommandOutput extends CommandOutput { |
107 // Although tests are reported as passing, content shell sometimes exits with | 107 // Although tests are reported as passing, content shell sometimes exits with |
108 // a nonzero exitcode which makes our dartium builders extremely falky. | 108 // a nonzero exitcode which makes our builders extremely flaky. |
109 // See: http://dartbug.com/15139. | 109 // See: http://dartbug.com/15139. |
110 // TODO(rnystrom): Is this still needed? The underlying bug is closed. | 110 // TODO(rnystrom): Is this still needed? The underlying bug is closed. |
111 static const _whitelistedContentShellExitCode = -1073740022; | 111 static const _whitelistedContentShellExitCode = -1073740022; |
112 | 112 |
113 static bool _failedBecauseOfFlakyInfrastructure( | 113 static bool _failedBecauseOfFlakyInfrastructure( |
114 Command command, bool timedOut, List<int> stderrBytes) { | 114 Command command, bool timedOut, List<int> stderrBytes) { |
115 // If the browser test failed, it may have been because content shell | 115 // If the browser test failed, it may have been because content shell |
116 // and the virtual framebuffer X server didn't hook up, or it crashed with | 116 // and the virtual framebuffer X server didn't hook up, or it crashed with |
117 // a core dump. Sometimes content shell crashes after it has set the stdout | 117 // a core dump. Sometimes content shell crashes after it has set the stdout |
118 // to PASS, so we have to do this check first. | 118 // to PASS, so we have to do this check first. |
(...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
830 // complete successfully, it's outcome is Expectation.FAIL. | 830 // complete successfully, it's outcome is Expectation.FAIL. |
831 // TODO: maybe we should introduce a AsyncIncomplete marker or so | 831 // TODO: maybe we should introduce a AsyncIncomplete marker or so |
832 if (outcome == Expectation.pass) { | 832 if (outcome == Expectation.pass) { |
833 if (_isAsyncTest(testOutput) && !_isAsyncTestSuccessful(testOutput)) { | 833 if (_isAsyncTest(testOutput) && !_isAsyncTestSuccessful(testOutput)) { |
834 return Expectation.fail; | 834 return Expectation.fail; |
835 } | 835 } |
836 } | 836 } |
837 return outcome; | 837 return outcome; |
838 } | 838 } |
839 } | 839 } |
OLD | NEW |