[Flaky tests] FIx test fork (#5671)

* Start testing test_fork

Maybe queue actor takes too long to initialize, that's why we are
seeing "Many python processes started" since most of the python
tasks are blocked on ray.get

* Add a comment
This commit is contained in:
Simon Mo
2019-09-09 19:21:20 -07:00
committed by GitHub
parent 0010f54378
commit 147e7d46ec
+4
View File
@@ -1787,9 +1787,13 @@ def setup_queue_actor():
def test_fork(setup_queue_actor):
queue = setup_queue_actor
# Make sure queue actor is initialized.
ray.get(queue.read.remote())
@ray.remote
def fork(queue, key, item):
# ray.get here could be blocked and cause ray to start
# a lot of python workers.
return ray.get(queue.enqueue.remote(key, item))
# Fork num_iters times.