-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sanitycheck: add option to allow re-running single tests multiple times #22147
Conversation
scripts/sanitycheck
Outdated
count = 0 | ||
passed = 0 | ||
failed = 0 | ||
while count < self.rerun: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could simplify to
for count in range(self.rerun):
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
run_i
and self.n_reruns
or the like might be clearer naming.
scripts/sanitycheck
Outdated
self.run() | ||
self.instance.status, _ = self.instance.handler.get_state() | ||
if self.instance.status in ['failed', 'timeout']: | ||
failed = failed + 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could do failed += 1
. Python has +=
.
scripts/sanitycheck
Outdated
if self.instance.status in ['failed', 'timeout']: | ||
failed = failed + 1 | ||
else: | ||
passed = passed + 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could do passed += 1
.
Using --number-of-runs <int> we now can run a single test multiple times to test for reproducibility and to catch sporadic failures. Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Using --number-of-runs we now can run a single test multiple times
to test for reproducibility and to catch sporadic failures.
The output looks like this: