Fix a few flaky tests (#9709)

Fix test_custom_resources, Remove test_pandas_parquet_serialization, Better error message for test_output.py, Potentially fix test_dynres::test_dynamic_res_creation_scheduler_consistency
This commit is contained in:
Robert Nishihara
2020-07-25 17:11:38 -07:00
committed by GitHub
parent 54a0d8b69e
commit a8efb214de
4 changed files with 10 additions and 33 deletions
+2 -7
View File
@@ -443,19 +443,17 @@ def test_multiple_raylets(ray_start_cluster):
def test_custom_resources(ray_start_cluster):
cluster = ray_start_cluster
cluster.add_node(num_cpus=3, resources={"CustomResource": 0})
cluster.add_node(num_cpus=1, resources={"CustomResource": 0})
custom_resource_node = cluster.add_node(
num_cpus=3, resources={"CustomResource": 1})
num_cpus=1, resources={"CustomResource": 1})
ray.init(address=cluster.address)
@ray.remote
def f():
time.sleep(0.001)
return ray.worker.global_worker.node.unique_id
@ray.remote(resources={"CustomResource": 1})
def g():
time.sleep(0.001)
return ray.worker.global_worker.node.unique_id
@ray.remote(resources={"CustomResource": 1})
@@ -463,9 +461,6 @@ def test_custom_resources(ray_start_cluster):
ray.get([f.remote() for _ in range(5)])
return ray.worker.global_worker.node.unique_id
# The f tasks should be scheduled on both raylets.
assert len(set(ray.get([f.remote() for _ in range(500)]))) == 2
# The g tasks should be scheduled only on the second raylet.
raylet_ids = set(ray.get([g.remote() for _ in range(50)]))
assert len(raylet_ids) == 1