twister: count retries after failures or errors
When twister is set to retry any failures, count the number of retries and record the number in the json file. This will help us identify unstable tests or tests requiring attention. Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
parent
4f458ba8de
commit
b89a3d955a
|
@ -267,6 +267,8 @@ class Reporting:
|
|||
if rom_size:
|
||||
suite["rom_size"] = rom_size
|
||||
|
||||
suite['retries'] = instance.retries
|
||||
|
||||
if instance.status in ["error", "failed"]:
|
||||
suite['status'] = instance.status
|
||||
suite["reason"] = instance.reason
|
||||
|
|
|
@ -972,6 +972,9 @@ class TwisterRunner:
|
|||
|
||||
if instance.status not in no_retry_statuses:
|
||||
logger.debug(f"adding {instance.name}")
|
||||
if instance.status:
|
||||
instance.retries += 1
|
||||
|
||||
instance.status = None
|
||||
if test_only and instance.run:
|
||||
pipeline.put({"op": "run", "test": instance})
|
||||
|
|
|
@ -40,6 +40,7 @@ class TestInstance:
|
|||
self.handler = None
|
||||
self.outdir = outdir
|
||||
self.execution_time = 0
|
||||
self.retries = 0
|
||||
|
||||
self.name = os.path.join(platform.name, testsuite.name)
|
||||
self.run_id = self._get_run_id()
|
||||
|
|
|
@ -524,6 +524,7 @@ class TestPlan:
|
|||
if status in ["error", "failed"]:
|
||||
instance.status = None
|
||||
instance.reason = None
|
||||
instance.retries += 1
|
||||
# test marked as passed (built only) but can run when
|
||||
# --test-only is used. Reset status to capture new results.
|
||||
elif status == 'passed' and instance.run and self.options.test_only:
|
||||
|
|
Loading…
Reference in a new issue