mirror of
https://github.com/wassname/ray.git
synced 2026-06-27 21:38:18 +08:00
fix test_global_state_api due to the temporary object (#8800)
* fix test_global_state_api due to the temporary object * update * Update python/ray/tests/test_advanced_3.py Co-authored-by: Robert Nishihara <robertnishihara@gmail.com> Co-authored-by: Robert Nishihara <robertnishihara@gmail.com>
This commit is contained in:
@@ -126,7 +126,14 @@ def test_global_state_api(shutdown_only):
|
||||
assert ray.cluster_resources()["GPU"] == 3
|
||||
assert ray.cluster_resources()["CustomResource"] == 1
|
||||
|
||||
assert ray.objects() == {}
|
||||
# A driver/worker creates a temporary object during startup. Although the
|
||||
# temporary object is freed immediately, in a rare case, we can still find
|
||||
# the object ID in GCS because Raylet removes the object ID from GCS
|
||||
# asynchronously.
|
||||
# Because we can't control when workers create the temporary objects, so
|
||||
# We can't assert that `ray.objects()` returns an empty dict. Here we just
|
||||
# make sure `ray.objects()` succeeds.
|
||||
assert len(ray.objects()) >= 0
|
||||
|
||||
job_id = ray.utils.compute_job_id_from_driver(
|
||||
ray.WorkerID(ray.worker.global_worker.worker_id))
|
||||
|
||||
Reference in New Issue
Block a user