Skip to content

Commit 1ccd972

Browse files
golowanownashif
authored andcommitted
twister: Fix on output directory reaching backup limit
Stop Twister if there are too many backup copies of the output directory already. Before this fix, Twister silently kept artifacts from the last run, unless `--clobber-output` was explicitly given. Signed-off-by: Dmitrii Golovanov <[email protected]>
1 parent d2607f0 commit 1ccd972

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

scripts/pylib/twister/twisterlib/twister_main.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ def main(options, default_options):
9494
print("Renaming output directory to {}".format(new_out))
9595
shutil.move(options.outdir, new_out)
9696
break
97+
else:
98+
sys.exit(f"Too many '{options.outdir}.*' directories. Run either with --no-clean, "
99+
"or --clobber-output, or delete these directories manually.")
97100

98101
previous_results_file = None
99102
os.makedirs(options.outdir, exist_ok=True)

0 commit comments

Comments
 (0)