From 9e9f1962c7b8fdc6dcb50b15df4d642333d7baed Mon Sep 17 00:00:00 2001 From: Edward Oakes Date: Mon, 2 Mar 2020 20:24:37 -0600 Subject: [PATCH] Enable test_actor_pool in CI (#7405) --- python/ray/tests/test_actor_pool.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/python/ray/tests/test_actor_pool.py b/python/ray/tests/test_actor_pool.py index a81d79fad..5f44be888 100644 --- a/python/ray/tests/test_actor_pool.py +++ b/python/ray/tests/test_actor_pool.py @@ -1,3 +1,4 @@ +import sys import time import pytest @@ -106,7 +107,7 @@ def test_get_next_timeout(init): pass def f(self, x): - while (True): + while True: x = x + 1 time.sleep(1) return None @@ -118,7 +119,7 @@ def test_get_next_timeout(init): pool = ActorPool(actors) pool.submit(lambda a, v: a.f.remote(v), 0) with pytest.raises(TimeoutError): - pool.get_next_unordered(5) + pool.get_next_unordered(timeout=0.1) def test_get_next_unordered_timeout(init): @@ -128,7 +129,7 @@ def test_get_next_unordered_timeout(init): pass def f(self, x): - while (True): + while True: x + 1 time.sleep(1) return @@ -141,4 +142,8 @@ def test_get_next_unordered_timeout(init): pool.submit(lambda a, v: a.f.remote(v), 0) with pytest.raises(TimeoutError): - pool.get_next_unordered(5) + pool.get_next_unordered(timeout=0.1) + + +if __name__ == "__main__": + sys.exit(pytest.main(["-v", __file__]))