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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/testing/dart/test_runner.dart
diff --git a/tools/testing/dart/test_runner.dart b/tools/testing/dart/test_runner.dart
index 132d0c6d7f3d6ffc5d84b467a290b11ff8dcbc9d..f8570c0200990185da7b3f31b382d74733f81544 100644
--- a/tools/testing/dart/test_runner.dart
+++ b/tools/testing/dart/test_runner.dart
@@ -1854,8 +1854,24 @@ class RunningProcess {
void timeoutHandler() {
timedOut = true;
if (process != null) {
- if (!process.kill()) {
- DebugLogger.error("Unable to kill ${process.pid}");
+ if (io.Platform.isLinux) {
+ // Try to print stack traces of the timed out process.
+ io.Process.run('eu-stack', ['-p ${process.pid}'])
+ .then((result) {
+ io.stdout.write(result.stdout);
+ io.stderr.write(result.stderr);
+ })
+ .catchError(
+ (error) => print("Error when printing stack trace: $error"))
+ .whenComplete(() {
+ if (!process.kill()) {
+ DebugLogger.error("Unable to kill ${process.pid}");
+ }
+ });
+ } else {
+ if (!process.kill()) {
+ DebugLogger.error("Unable to kill ${process.pid}");
+ }
}
}
}
« 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