Skip to content
Permalink
Browse files

sanitycheck: capture delayed faults

Do not close console after PASS is reported, wait a bit for any
remaining messages from the tests, sometimes we have faults that need to
be parsed.
This now works for Qemu handler, support for other handlers to follow.

Fixes #9646

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
  • Loading branch information...
nashif committed Aug 29, 2018
1 parent 350026e commit 39ae72b4cbffb20bedb61380dedcf185adf32dea
Showing with 19 additions and 4 deletions.
  1. +2 −1 scripts/sanity_chk/harness.py
  2. +17 −3 scripts/sanitycheck
@@ -64,7 +64,8 @@ class Test(Harness):
"MPU FAULT",
"Kernel Panic",
"Kernel OOPS",
"BUS FAULT"
"BUS FAULT",
"CPU Page Fault"
]

def handle(self, line):
@@ -526,13 +526,15 @@ class QEMUHandler(Handler):
timeout_time = start_time + timeout
p = select.poll()
p.register(in_fp, select.POLLIN)
out_state = None

metrics = {}
line = ""
while True:
this_timeout = int((timeout_time - time.time()) * 1000)
if this_timeout < 0 or not p.poll(this_timeout):
out_state = "timeout"
if not out_state:
out_state = "timeout"
break

try:
@@ -558,8 +560,20 @@ class QEMUHandler(Handler):

harness.handle(line)
if harness.state:
out_state = harness.state
break
# if we have registered a fail make sure the state is not
# overridden by a false success message coming from the
# testsuite
if out_state != 'failed':
out_state = harness.state

# if we get some state, that means test is doing well, we reset
# the timeout and wait for 5 more seconds just in case we have
# crashed after test has completed

if harness.type:
break
else:
timeout_time = time.time() + 2

# TODO: Add support for getting numerical performance data
# from test cases. Will involve extending test case reporting

0 comments on commit 39ae72b

Please sign in to comment.
You can’t perform that action at this time.