mirror of
https://github.com/wassname/ray.git
synced 2026-08-01 12:51:09 +08:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user