Skip to content

Commit

Permalink
tests: fix edge case in checkpoint test
Browse files Browse the repository at this point in the history
When running Python tests locally multiple times, the checkpoint
load tests may succeed even if the corresponding checkpoint save
tests failed. Old checkpoint files are now garbage collected.
  • Loading branch information
jngrad committed May 1, 2020
1 parent 435f391 commit d82b49d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions testsuite/python/save_checkpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@
checkpoint = espressomd.checkpointing.Checkpoint(
checkpoint_id=idx, checkpoint_path="@CMAKE_CURRENT_BINARY_DIR@")

# cleanup old checkpoint files
if checkpoint.has_checkpoints():
for filepath in os.listdir(checkpoint.checkpoint_dir):
if filepath.endswith((".checkpoint", ".cpt")):
os.remove(os.path.join(checkpoint.checkpoint_dir, filepath))

LB_implementation = None
if 'LB.CPU' in modes:
LB_implementation = espressomd.lb.LBFluid
Expand Down

0 comments on commit d82b49d

Please sign in to comment.