Skip to content

Commit 39ae72b

Browse files
committed
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 <[email protected]>
1 parent 350026e commit 39ae72b

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

scripts/sanity_chk/harness.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ class Test(Harness):
6464
"MPU FAULT",
6565
"Kernel Panic",
6666
"Kernel OOPS",
67-
"BUS FAULT"
67+
"BUS FAULT",
68+
"CPU Page Fault"
6869
]
6970

7071
def handle(self, line):

scripts/sanitycheck

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -526,13 +526,15 @@ class QEMUHandler(Handler):
526526
timeout_time = start_time + timeout
527527
p = select.poll()
528528
p.register(in_fp, select.POLLIN)
529+
out_state = None
529530

530531
metrics = {}
531532
line = ""
532533
while True:
533534
this_timeout = int((timeout_time - time.time()) * 1000)
534535
if this_timeout < 0 or not p.poll(this_timeout):
535-
out_state = "timeout"
536+
if not out_state:
537+
out_state = "timeout"
536538
break
537539

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

559561
harness.handle(line)
560562
if harness.state:
561-
out_state = harness.state
562-
break
563+
# if we have registered a fail make sure the state is not
564+
# overridden by a false success message coming from the
565+
# testsuite
566+
if out_state != 'failed':
567+
out_state = harness.state
568+
569+
# if we get some state, that means test is doing well, we reset
570+
# the timeout and wait for 5 more seconds just in case we have
571+
# crashed after test has completed
572+
573+
if harness.type:
574+
break
575+
else:
576+
timeout_time = time.time() + 2
563577

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

0 commit comments

Comments
 (0)