Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 1025 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1036 return Expectation.FAIL; | 1036 return Expectation.FAIL; |
| 1037 } | 1037 } |
| 1038 } | 1038 } |
| 1039 | 1039 |
| 1040 class BrowserCommandOutputImpl extends CommandOutputImpl { | 1040 class BrowserCommandOutputImpl extends CommandOutputImpl { |
| 1041 // Although tests are reported as passing, content shell sometimes exits with | 1041 // Although tests are reported as passing, content shell sometimes exits with |
| 1042 // a nonzero exitcode which makes our dartium builders extremely falky. | 1042 // a nonzero exitcode which makes our dartium builders extremely falky. |
| 1043 // See: http://dartbug.com/15139. | 1043 // See: http://dartbug.com/15139. |
| 1044 static int WHITELISTED_CONTENTSHELL_EXITCODE = -1073740022; | 1044 static int WHITELISTED_CONTENTSHELL_EXITCODE = -1073740022; |
| 1045 static bool isWindows = io.Platform.operatingSystem == 'windows'; | 1045 static bool isWindows = io.Platform.operatingSystem == 'windows'; |
| 1046 static bool _failedBecauseOfFlakyInfrastructure(List<int> stderrBytes) { | 1046 static bool _failedBecauseOfFlakyInfrastructure( |
| 1047 Command command, bool timedOut, List<int> stderrBytes) { | |
| 1047 // If the browser test failed, it may have been because content shell | 1048 // If the browser test failed, it may have been because content shell |
| 1048 // and the virtual framebuffer X server didn't hook up, or it crashed with | 1049 // and the virtual framebuffer X server didn't hook up, or it crashed with |
| 1049 // a core dump. Sometimes content shell crashes after it has set the stdout | 1050 // a core dump. Sometimes content shell crashes after it has set the stdout |
| 1050 // to PASS, so we have to do this check first. | 1051 // to PASS, so we have to do this check first. |
| 1051 // Content shell also fails with a broken pipe message: Issue 26739 | 1052 // Content shell also fails with a broken pipe message: Issue 26739 |
| 1052 var zygoteCrash = | 1053 var zygoteCrash = |
| 1053 new RegExp(r"ERROR:zygote_linux\.cc\(\d+\)] write: Broken pipe"); | 1054 new RegExp(r"ERROR:zygote_linux\.cc\(\d+\)] write: Broken pipe"); |
| 1054 var stderr = decodeUtf8(stderrBytes); | 1055 var stderr = decodeUtf8(stderrBytes); |
| 1055 // TODO(whesse): Issue: 7564 | 1056 // TODO(7564): See http://dartbug.com/7564 |
| 1056 // This may not be happening anymore. Test by removing this suppression. | 1057 // This may not be happening anymore. Test by removing this suppression. |
| 1057 if (stderr.contains(MESSAGE_CANNOT_OPEN_DISPLAY) || | 1058 if (stderr.contains(MESSAGE_CANNOT_OPEN_DISPLAY) || |
| 1058 stderr.contains(MESSAGE_FAILED_TO_RUN_COMMAND)) { | 1059 stderr.contains(MESSAGE_FAILED_TO_RUN_COMMAND)) { |
| 1059 DebugLogger.warning( | 1060 DebugLogger.warning( |
| 1060 "Warning: Failure because of missing XDisplay. Test ignored"); | 1061 "Warning: Failure because of missing XDisplay. Test ignored"); |
| 1061 return true; | 1062 return true; |
| 1062 } | 1063 } |
| 1063 // Issue 26739 | 1064 // TODO(26739): See http://dartbug.com/26739 |
| 1064 if (zygoteCrash.hasMatch(stderr)) { | 1065 if (zygoteCrash.hasMatch(stderr)) { |
| 1065 DebugLogger.warning("Warning: Failure because of content_shell " | 1066 DebugLogger.warning("Warning: Failure because of content_shell " |
| 1066 "zygote crash. Test ignored"); | 1067 "zygote crash. Test ignored"); |
| 1067 return true; | 1068 return true; |
| 1068 } | 1069 } |
| 1070 // TODO(28955): See http://dartbug.com/28955 | |
| 1071 if (timedOut && | |
| 1072 command is BrowserTestCommand && | |
| 1073 command.browser == "ie11") { | |
|
Siggi Cherem (dart-lang)
2017/05/10 15:05:45
Since we have rarely seen ie11 timeout on win8, sh
| |
| 1074 DebugLogger.warning("Timeout of ie11 on test page ${command.url}"); | |
| 1075 return; | |
|
karlklose
2017/05/11 11:25:41
This should return a boolean value.
| |
| 1076 } | |
| 1069 return false; | 1077 return false; |
| 1070 } | 1078 } |
| 1071 | 1079 |
| 1072 bool _infraFailure; | 1080 bool _infraFailure; |
| 1073 | 1081 |
| 1074 BrowserCommandOutputImpl( | 1082 BrowserCommandOutputImpl( |
| 1075 command, exitCode, timedOut, stdout, stderr, time, compilationSkipped) | 1083 command, exitCode, timedOut, stdout, stderr, time, compilationSkipped) |
| 1076 : _infraFailure = _failedBecauseOfFlakyInfrastructure(stderr), | 1084 : _infraFailure = |
| 1085 _failedBecauseOfFlakyInfrastructure(command, timedOut, stderr), | |
| 1077 super(command, exitCode, timedOut, stdout, stderr, time, | 1086 super(command, exitCode, timedOut, stdout, stderr, time, |
| 1078 compilationSkipped, 0); | 1087 compilationSkipped, 0); |
| 1079 | 1088 |
| 1080 Expectation result(TestCase testCase) { | 1089 Expectation result(TestCase testCase) { |
| 1081 // Handle crashes and timeouts first | 1090 // Handle crashes and timeouts first |
| 1082 if (hasCrashed) return Expectation.CRASH; | 1091 if (hasCrashed) return Expectation.CRASH; |
| 1083 if (hasTimedOut) return Expectation.TIMEOUT; | 1092 if (hasTimedOut) return Expectation.TIMEOUT; |
| 1084 if (hasNonUtf8) return Expectation.NON_UTF8_ERROR; | 1093 if (hasNonUtf8) return Expectation.NON_UTF8_ERROR; |
| 1085 | 1094 |
| 1086 if (_infraFailure) { | 1095 if (_infraFailure) { |
| (...skipping 2155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3242 } | 3251 } |
| 3243 } | 3252 } |
| 3244 | 3253 |
| 3245 void eventAllTestsDone() { | 3254 void eventAllTestsDone() { |
| 3246 for (var listener in _eventListener) { | 3255 for (var listener in _eventListener) { |
| 3247 listener.allDone(); | 3256 listener.allDone(); |
| 3248 } | 3257 } |
| 3249 _allDone(); | 3258 _allDone(); |
| 3250 } | 3259 } |
| 3251 } | 3260 } |
| OLD | NEW |