twister: marked tests causing timeout as fail
When a test start, mark it as such, if we do not get any results due to a timeout, it will be finally marked as failed. Previously such tests causing a freeze were marked as blocked (or not run), which is not exactly right. Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
parent
65b483bd7b
commit
81a1e9d686
3 changed files with 14 additions and 4 deletions
|
@ -268,6 +268,14 @@ class Test(Harness):
|
|||
self.detected_suite_names.append(suite_name)
|
||||
|
||||
testcase_match = re.search(self.ZTEST_START_PATTERN, line)
|
||||
if testcase_match:
|
||||
name = "{}.{}".format(self.id, testcase_match.group(2))
|
||||
tc = self.instance.get_case_or_create(name)
|
||||
# Mark the test as started, if something happens here, it is mostly
|
||||
# due to this tests, for example timeout. This should in this case
|
||||
# be marked as failed and not blocked (not run).
|
||||
tc.status = "started"
|
||||
|
||||
if testcase_match or self._match:
|
||||
self.testcase_output += line + "\n"
|
||||
self._match = True
|
||||
|
@ -275,10 +283,9 @@ class Test(Harness):
|
|||
result_match = result_re.match(line)
|
||||
|
||||
if result_match and result_match.group(2):
|
||||
matched_status = result_match.group(1)
|
||||
name = "{}.{}".format(self.id, result_match.group(3))
|
||||
tc = self.instance.get_case_or_create(name)
|
||||
|
||||
matched_status = result_match.group(1)
|
||||
tc.status = self.ztest_to_status[matched_status]
|
||||
if tc.status == "skipped":
|
||||
tc.reason = "ztest skip"
|
||||
|
@ -292,6 +299,7 @@ class Test(Harness):
|
|||
self.process_test(line)
|
||||
|
||||
if not self.ztest and self.state:
|
||||
logger.debug(f"not a ztest and no state for {self.id}")
|
||||
tc = self.instance.get_case_or_create(self.id)
|
||||
if self.state == "passed":
|
||||
tc.status = "passed"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue