[RLlib] Fix test_env_with_subprocess.py. (#11356)

This commit is contained in:
Sven Mika
2020-10-13 12:42:20 -07:00
committed by GitHub
parent 63fa0a53a3
commit a6a94d3206
3 changed files with 10 additions and 9 deletions
+1 -1
View File
@@ -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"]
)
+5 -6
View File
@@ -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")
+4 -2
View File
@@ -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()