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

Unified Diff: tools/testing/dart/test_runner.dart

Issue 2371383005: Attempt to print the stack traces of hung test processes on MacOS (Closed)
Patch Set: 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 b640ce36135373aa5b977c20851642730eb2d5b6..220d3ebc93085da57b18988a6a31c60e2c5c9389 100644
--- a/tools/testing/dart/test_runner.dart
+++ b/tools/testing/dart/test_runner.dart
@@ -1868,6 +1868,21 @@ class RunningProcess {
DebugLogger.error("Unable to kill ${process.pid}");
}
});
+ } else if (io.Platform.isMacOS) {
+ // Try to print stack traces of the timed out process.
+ io.Process.run('/usr/bin/sample',
+ ['${process.pid}', '1', '1', '-mayDie'])
+ .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