Skip to content

Commit

Permalink
Improve formatting of chaos mode test results
Browse files Browse the repository at this point in the history
  • Loading branch information
rocallahan committed Sep 20, 2024
1 parent daee39c commit 9476ad0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/chaos-test/harness.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def run(rr_params):
out_array = []
with open(d + "/out", 'r') as out:
for line in out:
out_array.append(line)
out_array.append(line.strip())
return [ret, out_array]
finally:
shutil.rmtree(d)
Expand All @@ -45,6 +45,7 @@ def run(rr_params):
def safe_exit(code):
pool.terminate()
pool.join()
print()
sys.exit(code)

print("Running %d iterations of %s/bin/%s %s without chaos mode"%(sanity_runs, objdir, name, ' '.join(params)))
Expand Down Expand Up @@ -72,7 +73,7 @@ def safe_exit(code):
if failed == 0:
print("First test failure detected, output:")
for line in r[1]:
print(line,)
print(line)
failed = failed + 1
if failed == 0:
print("PROBLEM: With chaos mode, test %s did not fail in %d runs"%(name, runs))
Expand All @@ -83,5 +84,5 @@ def safe_exit(code):
print("PROBLEM: Chaos mode didn't really help!")
safe_exit(3)

print("SUCCESS")
safe_exit(0)
print()

0 comments on commit 9476ad0

Please sign in to comment.