summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Palatin <vpalatin@chromium.org>2018-01-10 15:09:12 +0100
committerchrome-bot <chrome-bot@chromium.org>2018-01-18 05:09:42 -0800
commit07230f772e90650eb8dbac444ebe629272306049 (patch)
tree41b3dabbdc2104cfc8655a1dbfe129845a8f61b6
parentd52ba1a4d4801fdba129be64fa4c1c53a7ced817 (diff)
downloadchrome-ec-07230f772e90650eb8dbac444ebe629272306049.tar.gz
Add more debugging to run_host_test
If a host test fails, record the execution state of the EC host process. This is an attempt to provide a hint whether the test was blocked on I/O, if so it might be in 'D' state (but it might have recovered too late too). Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=none BUG=chromium:715011 TEST=run 'make runtests -j', then run it again with TIMEOUT reduced to 1 see it fail on 'kb_scan' and 'interrupt' tests with the trace containing '*** test [...] in state Ssl+ ***' Change-Id: I4590a4b84a2aba8d385d3ef911d5d0186e8ce2e3 Reviewed-on: https://chromium-review.googlesource.com/859771 Commit-Ready: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
-rwxr-xr-xutil/run_host_test7
1 files changed, 7 insertions, 0 deletions
diff --git a/util/run_host_test b/util/run_host_test
index c130b822fb..c0482a7863 100755
--- a/util/run_host_test
+++ b/util/run_host_test
@@ -7,6 +7,7 @@
from cStringIO import StringIO
import pexpect
import signal
+import subprocess
import sys
import time
@@ -19,6 +20,8 @@ RESULT_ID_EOF = 3
EXPECT_LIST = [pexpect.TIMEOUT, 'Pass!', 'Fail!', pexpect.EOF]
+PS_ARGS = ['ps', '--no-headers', '-o', 'stat', '--pid']
+
class Tee(object):
def __init__(self, target):
self._target = target
@@ -39,6 +42,10 @@ def RunOnce(test_name, log):
return child.expect(EXPECT_LIST)
finally:
if child.isalive():
+ ps_cmd = PS_ARGS + ['%d' % (child.pid)]
+ ps_stat = subprocess.check_output(ps_cmd).strip()
+ log.write('\n*** test %s process %d in state %s ***\n' %
+ (test_name, child.pid, ps_stat))
child.kill(signal.SIGTERM)
child.read()