mirror of
https://github.com/littlefs-project/littlefs.git
synced 2025-12-01 12:20:02 +00:00
Fixed race condition killing test processes in test/bench.py
Note sure why we weren't hitting this earlier, but I've been hitting this race condition a bunch recently and it's annoying. Now every failed process kills the other test processes unconditionally. It's not clear if this actually _fixes_ the race condition or just makes it less likely, but it's good enough to keep the test script user friendly.
This commit is contained in:
@ -1134,14 +1134,13 @@ def run_stage(name, runner, bench_ids, stdout_, trace_, output_, **args):
|
|||||||
|
|
||||||
except BenchFailure as failure:
|
except BenchFailure as failure:
|
||||||
# race condition for multiple failures?
|
# race condition for multiple failures?
|
||||||
if failures and not args.get('keep_going'):
|
if not failures or args.get('keep_going'):
|
||||||
break
|
|
||||||
|
|
||||||
# keep track of how many failed
|
# keep track of how many failed
|
||||||
failed_perms += 1
|
failed_perms += 1
|
||||||
|
|
||||||
# do not store more failures than we need to, otherwise we
|
# do not store more failures than we need to, otherwise
|
||||||
# quickly explode RAM when a common bug fails a bunch of cases
|
# we quickly explode RAM when a common bug fails a bunch
|
||||||
|
# of cases
|
||||||
if len(failures) < args.get('failures', 3):
|
if len(failures) < args.get('failures', 3):
|
||||||
failures.append(failure)
|
failures.append(failure)
|
||||||
|
|
||||||
|
|||||||
@ -1113,14 +1113,13 @@ def run_stage(name, runner, test_ids, stdout_, trace_, output_, **args):
|
|||||||
**defines})
|
**defines})
|
||||||
|
|
||||||
# race condition for multiple failures?
|
# race condition for multiple failures?
|
||||||
if failures and not args.get('keep_going'):
|
if not failures or args.get('keep_going'):
|
||||||
break
|
|
||||||
|
|
||||||
# keep track of how many failed
|
# keep track of how many failed
|
||||||
failed_perms += 1
|
failed_perms += 1
|
||||||
|
|
||||||
# do not store more failures than we need to, otherwise we
|
# do not store more failures than we need to, otherwise
|
||||||
# quickly explode RAM when a common bug fails a bunch of cases
|
# we quickly explode RAM when a common bug fails a bunch
|
||||||
|
# of cases
|
||||||
if len(failures) < args.get('failures', 3):
|
if len(failures) < args.get('failures', 3):
|
||||||
failures.append(failure)
|
failures.append(failure)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user