mirror of
https://github.com/wassname/ray.git
synced 2026-06-29 21:26:08 +08:00
Fix wait timeout logic (#10199)
This commit is contained in:
@@ -258,6 +258,22 @@ def test_put_get(shutdown_only):
|
||||
assert value_before == value_after
|
||||
|
||||
|
||||
def test_wait_timing(shutdown_only):
|
||||
ray.init(num_cpus=2)
|
||||
|
||||
@ray.remote
|
||||
def f():
|
||||
time.sleep(1)
|
||||
|
||||
future = f.remote()
|
||||
|
||||
start = time.time()
|
||||
ready, not_ready = ray.wait([future], timeout=0.2)
|
||||
assert 0.2 < time.time() - start < 0.3
|
||||
assert len(ready) == 0
|
||||
assert len(not_ready) == 1
|
||||
|
||||
|
||||
def test_function_descriptor():
|
||||
python_descriptor = ray._raylet.PythonFunctionDescriptor(
|
||||
"module_name", "function_name", "class_name", "function_hash")
|
||||
|
||||
Reference in New Issue
Block a user