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>
This commit is contained in:
parent
350026e8c8
commit
39ae72b4cb
2 changed files with 19 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue