Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: tools/testing/dart/test_runner.dart

Issue 2320473004: test.dart: Print stack traces of all threads when a test times out (Closed)
Patch Set: use eu-stack Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1836 matching lines...) Expand 10 before | Expand all | Expand 10 after
1847 watchdogTimer.cancel(); 1847 watchdogTimer.cancel();
1848 } 1848 }
1849 } 1849 }
1850 } 1850 }
1851 1851
1852 // Close stdin so that tests that try to block on input will fail. 1852 // Close stdin so that tests that try to block on input will fail.
1853 process.stdin.close(); 1853 process.stdin.close();
1854 void timeoutHandler() { 1854 void timeoutHandler() {
1855 timedOut = true; 1855 timedOut = true;
1856 if (process != null) { 1856 if (process != null) {
1857 if (!process.kill()) { 1857 if (io.Platform.isLinux) {
1858 DebugLogger.error("Unable to kill ${process.pid}"); 1858 // Try to print stack traces of the timed out process.
1859 io.Process.run('eu-stack', ['-p ${process.pid}'])
1860 .then((result) {
1861 io.stdout.write(result.stdout);
1862 io.stderr.write(result.stderr);
1863 })
1864 .catchError(
1865 (error) => print("Error when printing stack trace: $error"))
1866 .whenComplete(() {
1867 if (!process.kill()) {
1868 DebugLogger.error("Unable to kill ${process.pid}");
1869 }
1870 });
1871 } else {
1872 if (!process.kill()) {
1873 DebugLogger.error("Unable to kill ${process.pid}");
1874 }
1859 } 1875 }
1860 } 1876 }
1861 } 1877 }
1862 1878
1863 stdoutSubscription.asFuture().then(closeStdout); 1879 stdoutSubscription.asFuture().then(closeStdout);
1864 stderrSubscription.asFuture().then(closeStderr); 1880 stderrSubscription.asFuture().then(closeStderr);
1865 1881
1866 process.exitCode.then((exitCode) { 1882 process.exitCode.then((exitCode) {
1867 if (!stdoutDone || !stderrDone) { 1883 if (!stdoutDone || !stderrDone) {
1868 watchdogTimer = new Timer(MAX_STDIO_DELAY, () { 1884 watchdogTimer = new Timer(MAX_STDIO_DELAY, () {
(...skipping 1175 matching lines...) Expand 10 before | Expand all | Expand 10 after
3044 } 3060 }
3045 } 3061 }
3046 3062
3047 void eventAllTestsDone() { 3063 void eventAllTestsDone() {
3048 for (var listener in _eventListener) { 3064 for (var listener in _eventListener) {
3049 listener.allDone(); 3065 listener.allDone();
3050 } 3066 }
3051 _allDone(); 3067 _allDone();
3052 } 3068 }
3053 } 3069 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698