mirror of
https://github.com/vale981/ray
synced 2025-03-06 02:21:39 -05:00
[RLlib] Fix test_env_with_subprocess.py. (#11356)
This commit is contained in:
parent
63fa0a53a3
commit
a6a94d3206
3 changed files with 10 additions and 9 deletions
|
@ -1184,7 +1184,7 @@ py_test(
|
|||
py_test(
|
||||
name = "tests/test_catalog",
|
||||
tags = ["tests_dir", "tests_dir_C"],
|
||||
size = "small",
|
||||
size = "medium",
|
||||
srcs = ["tests/test_catalog.py"]
|
||||
)
|
||||
|
||||
|
|
|
@ -56,11 +56,10 @@ if __name__ == "__main__":
|
|||
},
|
||||
},
|
||||
})
|
||||
# Check whether processes are still running or Env has not cleaned up
|
||||
# the given tmp files.
|
||||
|
||||
ray.shutdown()
|
||||
|
||||
# Check whether processes are still running.
|
||||
wait_for_condition(lambda: not leaked_processes(), timeout=30)
|
||||
wait_for_condition(lambda: not os.path.exists(tmp1), timeout=30)
|
||||
wait_for_condition(lambda: not os.path.exists(tmp2), timeout=30)
|
||||
wait_for_condition(lambda: not os.path.exists(tmp3), timeout=30)
|
||||
wait_for_condition(lambda: not os.path.exists(tmp4), timeout=30)
|
||||
|
||||
print("OK")
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import unittest
|
||||
|
||||
import ray
|
||||
from ray.rllib.agents.ppo import PPOTrainer, DEFAULT_CONFIG
|
||||
from ray.rllib.agents.pg import PGTrainer, DEFAULT_CONFIG
|
||||
from ray.rllib.utils.test_utils import framework_iterator
|
||||
|
||||
|
||||
|
@ -14,8 +14,10 @@ class LocalModeTest(unittest.TestCase):
|
|||
|
||||
def test_local(self):
|
||||
cf = DEFAULT_CONFIG.copy()
|
||||
cf["model"]["fcnet_hiddens"] = [10]
|
||||
|
||||
for _ in framework_iterator(cf):
|
||||
agent = PPOTrainer(cf, "CartPole-v0")
|
||||
agent = PGTrainer(cf, "CartPole-v0")
|
||||
print(agent.train())
|
||||
agent.stop()
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue