Skip to content

[core] Remove use of deprecated obj_ref.as_future() in tests#63503

Open
edoakes wants to merge 5 commits into
ray-project:masterfrom
edoakes:eoakes/fix-deprecated-asyncio
Open

[core] Remove use of deprecated obj_ref.as_future() in tests#63503
edoakes wants to merge 5 commits into
ray-project:masterfrom
edoakes:eoakes/fix-deprecated-asyncio

Conversation

@edoakes
Copy link
Copy Markdown
Collaborator

@edoakes edoakes commented May 19, 2026

Saw a bunch of warnings like:

2026-05-19 09:11:48,830 WARNING test_asyncio.py:136 -- ref.as_future() is deprecated in favor of asyncio.wrap_future(ref.future()).

edoakes added 2 commits May 19, 2026 09:21
Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
@edoakes edoakes requested a review from a team as a code owner May 19, 2026 14:22
@edoakes edoakes added the go add ONLY when ready to merge, run all tests label May 19, 2026
Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors asynchronous tests by replacing the deprecated .as_future() method with asyncio.wrap_future(....future()) or by directly awaiting ObjectRef instances. It also updates test fixtures and reduces a timeout value in test_wait_timeout. Review feedback suggests further simplifying the code by using asyncio.ensure_future() or passing ObjectRef objects directly to asyncio.gather and asyncio.wait, as they are already awaitable.

Comment thread python/ray/tests/test_async.py Outdated
Comment thread python/ray/tests/test_async.py Outdated
Comment thread python/ray/tests/test_async.py Outdated
Comment thread python/ray/tests/test_async.py Outdated
Comment thread python/ray/tests/test_async.py
Comment thread python/ray/tests/test_async.py
Comment thread python/ray/tests/test_asyncio.py Outdated
edoakes and others added 2 commits May 19, 2026 09:28
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

go add ONLY when ready to merge, run all tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant