Skip to content

Commit

Permalink
fix(nyz): reduce env manager unittest num
Browse files Browse the repository at this point in the history
  • Loading branch information
PaParaZz1 committed Jan 2, 2023
1 parent 9b70def commit 05a006b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ding/envs/env_manager/tests/test_env_supervisor.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ def test_reset_error_once(self, setup_base_manager_cfg, type_):
# Normal step
env_supervisor.step({i: np.random.randn(4) for i in range(env_supervisor.env_num)}, block=False)
timestep = []
while len(timestep) != 4:
while len(timestep) != 3:
payload = env_supervisor.recv()
if payload.method == "step":
timestep.append(payload.data)
Expand All @@ -311,7 +311,7 @@ def test_reset_error_once(self, setup_base_manager_cfg, type_):
env_supervisor.reset(reset_param, block=False) # Second try, error and recover

reset_obs = []
while len(reset_obs) != 8:
while len(reset_obs) != 6:
reset_obs.append(env_supervisor.recv(ignore_err=True))
assert env_supervisor.time_id[0] == env_id_0
assert all([state == EnvState.RUN for state in env_supervisor.env_states.values()])
Expand All @@ -334,7 +334,7 @@ def test_renew_error_once(self, setup_base_manager_cfg, type_):
env_supervisor.reset(reset_param, block=False)

reset_obs = []
while len(reset_obs) != 8:
while len(reset_obs) != 6:
reset_obs.append(env_supervisor.recv(ignore_err=True))

assert env_supervisor.time_id[0] != env_id_0
Expand All @@ -346,7 +346,7 @@ def test_renew_error_once(self, setup_base_manager_cfg, type_):
env_supervisor.step(action, block=False)

timestep = {}
while len(timestep) != 4:
while len(timestep) != 3:
payload = env_supervisor.recv()
if payload.method == "step":
timestep[payload.proc_id] = payload.data
Expand Down

0 comments on commit 05a006b

Please sign in to comment.