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

Unified Diff: build/android/test_runner.py

Issue 2549863003: [Android] Dump thread stacks on SIGTERM in test_runner.py. (Closed)
Patch Set: Created 4 years 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: build/android/test_runner.py
diff --git a/build/android/test_runner.py b/build/android/test_runner.py
index 695d0eea7ea87820d47418685595e5692fcbe091..12879f9d9b58b7cd6a0fd69c324fbc78b1cd32f2 100755
--- a/build/android/test_runner.py
+++ b/build/android/test_runner.py
@@ -15,6 +15,7 @@ import os
import signal
import sys
import threading
+import traceback
import unittest
import devil_chromium
@@ -700,7 +701,19 @@ def RunTestsInPlatformMode(args):
### Set up sigterm handler.
def unexpected_sigterm(_signum, _frame):
- infra_error('Received SIGTERM. Shutting down.')
+ msg = [
+ 'Received SIGTERM. Shutting down.',
+ ]
+ for live_thread in threading.enumerate():
+ # pylint: disable=protected-access
+ thread_stack = ''.join(traceback.format_stack(
+ sys._current_frames()[live_thread.ident]))
+ msg.extend([
+ 'Thread "%s" (ident: %s) is currently running:' % (
+ live_thread.name, live_thread.ident),
+ thread_stack])
+
+ infra_error('\n'.join(msg))
sigterm_handler = signal_handler.SignalHandler(
signal.SIGTERM, unexpected_sigterm)
« 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