You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
__________________________________________________________________________________________________________________________ test_call_async_method __________________________________________________________________________________________________________________________
@pytest.mark.asyncio
async def test_call_async_method():
"""
It should allow us to call a synchronous method on an actor
"""
cls = ray.remote(DemoCounterActor)
demo_actor = cls.options(name="demo").remote(counter=12)
> assert await demo_actor.get_counter_async.remote() == 12
E ray.exceptions.RayTaskError(TypeError): ray::DemoCounterActor.get_counter_async() (pid=1375208, ip=172.20.248.27, actor_id=2a97be7da0f4ff9c8a967ed001000000, repr=<demo.actor_counter.DemoCounterActor object at 0x7fea2b858e50>)
E File "/home/xanrin/.pyenv/versions/3.9.18/lib/python3.9/site-packages/ray/cloudpickle/cloudpickle_fast.py", line 88, in dumps
E cp.dump(obj)
E File "/home/xanrin/.pyenv/versions/3.9.18/lib/python3.9/site-packages/ray/cloudpickle/cloudpickle_fast.py", line 733, in dump
E return Pickler.dump(self, obj)
E TypeError: cannot pickle '_cython_3_0_8.coroutine' object
tests/unit/actor/test_actor.py:131: RayTaskError(TypeError)
Versions / Dependencies
Tested on Ray 2.8.0 and Ray 2.9.2 on Ubuntu and Mac OS
@pytest.mark.asyncioasyncdeftest_call_async_method():
""" It should allow us to call a synchronous method on an actor """cls=ray.remote(DemoCounterActor)
demo_actor=cls.options(name="demo").remote(counter=12)
assertawaitdemo_actor.get_counter_async.remote() ==12awaitdemo_actor.increment_async.remote()
assertawaitdemo_actor.get_counter_async.remote() ==13ray.kill(demo_actor)
Issue Severity
High: It blocks me from completing my task.
The text was updated successfully, but these errors were encountered:
Note that there is an old unmaintained prototype by @llllllllll to add support for pickling instances of generators discussed in #146 and implemented at https://github.com/llllllllll/cloudpickle-generators. That could be a start but I am not sure if it would be easy to generalize to regular asyncio coroutines and their Cython counterparts.
What happened + What you expected to happen
cannot pickle '_cython_3_0_8.coroutine' object
Test output
Stacktrace
Versions / Dependencies
Tested on Ray 2.8.0 and Ray 2.9.2 on Ubuntu and Mac OS
Reproduction script
Define a Demo Actor:
Cythonize it
Then use a test:
Issue Severity
High: It blocks me from completing my task.
The text was updated successfully, but these errors were encountered: