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 1852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1863 }) | 1863 }) |
1864 .catchError( | 1864 .catchError( |
1865 (error) => print("Error when printing stack trace: $error")) | 1865 (error) => print("Error when printing stack trace: $error")) |
1866 .whenComplete(() { | 1866 .whenComplete(() { |
1867 if (!process.kill()) { | 1867 if (!process.kill()) { |
1868 DebugLogger.error("Unable to kill ${process.pid}"); | 1868 DebugLogger.error("Unable to kill ${process.pid}"); |
1869 } | 1869 } |
1870 }); | 1870 }); |
1871 } else if (io.Platform.isMacOS) { | 1871 } else if (io.Platform.isMacOS) { |
1872 // Try to print stack traces of the timed out process. | 1872 // Try to print stack traces of the timed out process. |
| 1873 // `sample` is a sampling profiler but we ask it sample for 1 |
| 1874 // second with a 4 second delay between samples so that we only |
| 1875 // sample the threads once. |
1873 io.Process.run('/usr/bin/sample', | 1876 io.Process.run('/usr/bin/sample', |
1874 ['${process.pid}', '1', '1', '-mayDie']) | 1877 ['${process.pid}', '1', '4000', '-mayDie']) |
1875 .then((result) { | 1878 .then((result) { |
1876 io.stdout.write(result.stdout); | 1879 io.stdout.write(result.stdout); |
1877 io.stderr.write(result.stderr); | 1880 io.stderr.write(result.stderr); |
1878 }) | 1881 }) |
1879 .catchError( | 1882 .catchError( |
1880 (error) => print("Error when printing stack trace: $error")) | 1883 (error) => print("Error when printing stack trace: $error")) |
1881 .whenComplete(() { | 1884 .whenComplete(() { |
1882 if (!process.kill()) { | 1885 if (!process.kill()) { |
1883 DebugLogger.error("Unable to kill ${process.pid}"); | 1886 DebugLogger.error("Unable to kill ${process.pid}"); |
1884 } | 1887 } |
(...skipping 1190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3075 } | 3078 } |
3076 } | 3079 } |
3077 | 3080 |
3078 void eventAllTestsDone() { | 3081 void eventAllTestsDone() { |
3079 for (var listener in _eventListener) { | 3082 for (var listener in _eventListener) { |
3080 listener.allDone(); | 3083 listener.allDone(); |
3081 } | 3084 } |
3082 _allDone(); | 3085 _allDone(); |
3083 } | 3086 } |
3084 } | 3087 } |
OLD | NEW |