Skip to content

Commit 7704041

Browse files
authored
[core] Deflake test_logging.py (#52749)
This test flakes because the task can get placed on either node. Example: https://buildkite.com/ray-project/postmerge/builds/9892#019691bf-f34b-4da3-9a71-285c4ed31d64 Added custom resource to pin scheduling. --------- Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
1 parent 10cc0f2 commit 7704041

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

python/ray/tests/test_logging.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1112,18 +1112,21 @@ def test_log_with_import():
11121112
def test_log_monitor_ip_correct(ray_start_cluster):
11131113
cluster = ray_start_cluster
11141114
# add first node
1115-
cluster.add_node(node_ip_address="127.0.0.2")
1115+
cluster.add_node(
1116+
node_ip_address="127.0.0.2",
1117+
resources={"pin_task": 1},
1118+
)
11161119
address = cluster.address
11171120
ray.init(address)
11181121
# add second node
11191122
cluster.add_node(node_ip_address="127.0.0.3")
11201123

1121-
@ray.remote
1124+
@ray.remote(resources={"pin_task": 1})
11221125
def print_msg():
11231126
print("abc")
11241127

11251128
p = init_log_pubsub()
1126-
print_msg.remote()
1129+
ray.get(print_msg.remote())
11271130
data = get_log_data(
11281131
p, num=6, timeout=10, job_id=ray.get_runtime_context().get_job_id()
11291132
)

0 commit comments

Comments
 (0)