Skip to content

Commit e4235fe

Browse files
committed
gymlib integtests no longer crash when run together with other integtests
1 parent 664728d commit e4235fe

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

env/tests/gymlib_integtest_util.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ def set_up_workspace() -> None:
6767
#
6868
# However, it also can't be created more than once so we need to check `is None`.
6969
if GymlibIntegtestManager.DBGYM_WORKSPACE is None:
70+
# Reset this in case it had been created by a test *not* using GymlibIntegtestManager.set_up_workspace().
71+
DBGymWorkspace.num_times_created_this_run = 0
7072
GymlibIntegtestManager.DBGYM_WORKSPACE = DBGymWorkspace(workspace_path)
7173

7274
@staticmethod

util/workspace.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ class DBGymWorkspace:
131131

132132
def __init__(self, dbgym_workspace_path: Path):
133133
# The logic around dbgym_tmp_path assumes that DBGymWorkspace is only constructed once.
134+
# This is because DBGymWorkspace creates a new run_*/ dir when it's initialized.
134135
DBGymWorkspace.num_times_created_this_run += 1
135136
assert (
136137
DBGymWorkspace.num_times_created_this_run == 1

0 commit comments

Comments
 (0)