Skip to content

Commit

Permalink
Try closing reporter in test for windows fix (#535)
Browse files Browse the repository at this point in the history
This PR attempts to fix the issue raised in #527. From what I can tell,
the tests where this is thrown always fails exactly at the same point.
This PR closes the reporter file formally before the failing line
occurs, so hopefully this will correctly allow Window's memory to
release the file.

Co-authored-by: Mike Henry <11765982+mikemhenry@users.noreply.github.com>
  • Loading branch information
Lnaden and mikemhenry committed Dec 14, 2021
1 parent a901eaf commit c0cc3e0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions openmmtools/tests/test_sampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -756,6 +756,9 @@ def test_create(self):
else:
assert not sampler._reporter.is_open()

# Ensure reporter is closed. Windows based system testing seems to get upset about this.
reporter.close()

# Open reporter to read stored data.
reporter = self.REPORTER(storage_path, open_mode='r', checkpoint_interval=1)

Expand Down

0 comments on commit c0cc3e0

Please sign in to comment.