Skip to content

Commit

Permalink
Ci fix for pytorch profiler log to file tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SeanNaren committed Apr 13, 2021
1 parent e8b48f1 commit 4c2005d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion tests/test_profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,10 @@ def test_advanced_profiler_describe(tmpdir, advanced_profiler):
# record at least one event
with advanced_profiler.profile("test"):
pass
# log to stdout and print to file
# logs to output file
advanced_profiler.describe()
# ensures file is flushed before reading
advanced_profiler.output_file.close()
data = Path(advanced_profiler.output_fname).read_text()
assert len(data) > 0

Expand Down
4 changes: 3 additions & 1 deletion tests/trainer/test_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1548,8 +1548,10 @@ def test_pytorch_profiler_describe(pytorch_profiler):
with pytorch_profiler.profile("test_step"):
pass

# log to stdout and print to file
# logs to output file
pytorch_profiler.describe()
# ensures file is flushed before reading
pytorch_profiler.output_file.close()
data = Path(pytorch_profiler.output_fname).read_text()
assert len(data) > 0

Expand Down

0 comments on commit 4c2005d

Please sign in to comment.