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 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
226 String displayName, | 226 String displayName, |
227 String outputFile, | 227 String outputFile, |
228 bool neverSkipCompilation, | 228 bool neverSkipCompilation, |
229 List<Uri> bootstrapDependencies, | 229 List<Uri> bootstrapDependencies, |
230 String executable, | 230 String executable, |
231 List<String> arguments, | 231 List<String> arguments, |
232 Map<String, String> environmentOverrides) | 232 Map<String, String> environmentOverrides) |
233 : super._(displayName, outputFile, neverSkipCompilation, | 233 : super._(displayName, outputFile, neverSkipCompilation, |
234 bootstrapDependencies, executable, arguments, | 234 bootstrapDependencies, executable, arguments, |
235 environmentOverrides); | 235 environmentOverrides); |
236 | |
237 int get maxNumRetries => 1; | |
236 } | 238 } |
237 | 239 |
238 /// This is just a Pair(String, Map) class with hashCode and operator == | 240 /// This is just a Pair(String, Map) class with hashCode and operator == |
239 class AddFlagsKey { | 241 class AddFlagsKey { |
240 final String flags; | 242 final String flags; |
241 final Map env; | 243 final Map env; |
242 AddFlagsKey(this.flags, this.env); | 244 AddFlagsKey(this.flags, this.env); |
243 // Just use object identity for environment map | 245 // Just use object identity for environment map |
244 bool operator ==(other) => | 246 bool operator ==(other) => |
245 other is AddFlagsKey && flags == other.flags && env == other.env; | 247 other is AddFlagsKey && flags == other.flags && env == other.env; |
(...skipping 2588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2834 if (!output.successful) { | 2836 if (!output.successful) { |
2835 List<String> stdout, stderr; | 2837 List<String> stdout, stderr; |
2836 | 2838 |
2837 decodeOutput() { | 2839 decodeOutput() { |
2838 if (stdout == null && stderr == null) { | 2840 if (stdout == null && stderr == null) { |
2839 stdout = decodeUtf8(output.stderr).split("\n"); | 2841 stdout = decodeUtf8(output.stderr).split("\n"); |
2840 stderr = decodeUtf8(output.stderr).split("\n"); | 2842 stderr = decodeUtf8(output.stderr).split("\n"); |
2841 } | 2843 } |
2842 } | 2844 } |
2843 | 2845 |
2846 final command = output.command; | |
2847 | |
2848 // The dartk batch compiler sometimes runs out of memory. In such a case we | |
2849 // will retry running it. | |
2850 if (command is KernelCompilationCommand) { | |
2851 if (output.hasCrashed) { | |
Vyacheslav Egorov (Google)
2016/12/14 13:49:49
Can we grep output for out of memory instead of re
kustermann
2016/12/15 11:37:18
Done.
| |
2852 return true; | |
2853 } | |
2854 } | |
2855 | |
2856 // We currently rerun dartium tests, see issue 14074. | |
2857 if (command is BrowserTestCommand && | |
2858 command.retry && | |
2859 command.browser == 'dartium') { | |
2860 return true; | |
2861 } | |
2862 | |
2844 if (io.Platform.operatingSystem == 'linux') { | 2863 if (io.Platform.operatingSystem == 'linux') { |
2845 decodeOutput(); | 2864 decodeOutput(); |
2846 // No matter which command we ran: If we get failures due to the | 2865 // No matter which command we ran: If we get failures due to the |
2847 // "xvfb-run" issue 7564, try re-running the test. | 2866 // "xvfb-run" issue 7564, try re-running the test. |
2848 bool containsFailureMsg(String line) { | 2867 bool containsFailureMsg(String line) { |
2849 return line.contains(MESSAGE_CANNOT_OPEN_DISPLAY) || | 2868 return line.contains(MESSAGE_CANNOT_OPEN_DISPLAY) || |
2850 line.contains(MESSAGE_FAILED_TO_RUN_COMMAND); | 2869 line.contains(MESSAGE_FAILED_TO_RUN_COMMAND); |
2851 } | 2870 } |
2852 if (stdout.any(containsFailureMsg) || stderr.any(containsFailureMsg)) { | 2871 if (stdout.any(containsFailureMsg) || stderr.any(containsFailureMsg)) { |
2853 return true; | 2872 return true; |
2854 } | 2873 } |
2855 } | 2874 } |
2856 | 2875 |
2857 // We currently rerun dartium tests, see issue 14074. | |
2858 final command = output.command; | |
2859 if (command is BrowserTestCommand && | |
2860 command.retry && | |
2861 command.browser == 'dartium') { | |
2862 return true; | |
2863 } | |
2864 } | 2876 } |
2865 return false; | 2877 return false; |
2866 } | 2878 } |
2867 | 2879 |
2868 /* | 2880 /* |
2869 * [TestCaseCompleter] will listen for | 2881 * [TestCaseCompleter] will listen for |
2870 * NodeState.Processing -> NodeState.{Successful,Failed} state changes and | 2882 * NodeState.Processing -> NodeState.{Successful,Failed} state changes and |
2871 * will complete a TestCase if it is finished. | 2883 * will complete a TestCase if it is finished. |
2872 * | 2884 * |
2873 * It provides a stream [finishedTestCases], which will stream all TestCases | 2885 * It provides a stream [finishedTestCases], which will stream all TestCases |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3152 } | 3164 } |
3153 } | 3165 } |
3154 | 3166 |
3155 void eventAllTestsDone() { | 3167 void eventAllTestsDone() { |
3156 for (var listener in _eventListener) { | 3168 for (var listener in _eventListener) { |
3157 listener.allDone(); | 3169 listener.allDone(); |
3158 } | 3170 } |
3159 _allDone(); | 3171 _allDone(); |
3160 } | 3172 } |
3161 } | 3173 } |
OLD | NEW |