MCPcopy Index your code
hub / github.com/ray-project/ray / test_concurrent_future_many

Function test_concurrent_future_many

python/ray/tests/test_async.py:158–170  ·  view source on GitHub ↗
(init)

Source from the content-addressed store, hash-verified

156
157
158def test_concurrent_future_many(init):
159 @ray.remote
160 def task(i):
161 return i
162
163 refs = [task.remote(i) for i in range(100)]
164 futs = [ref.future() for ref in refs]
165 result = set()
166
167 for fut in concurrent.futures.as_completed(futs):
168 assert fut.done()
169 result.add(fut.result())
170 assert result == set(range(100))
171
172
173if __name__ == "__main__":

Callers

nothing calls this directly

Calls 6

futureMethod · 0.80
rangeFunction · 0.50
remoteMethod · 0.45
doneMethod · 0.45
addMethod · 0.45
resultMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…