mirror of
https://github.com/wassname/ray.git
synced 2026-06-30 16:49:48 +08:00
Clean up actor state from the GCS (#8261)
* parametrize test * Regression test and logging * Test no restart after actor deletion * Unit tests * Refactor to subscribe to and lookup from worker failure table * Refactor ActorManager to remove dependencies * Revert "Regression test and logging" This reverts commit 835e1a9091b51ca8efb00392d4cc4a665145de24. * Revert "parametrize test" This reverts commit f31272082831ba1a494816dd5511d87b24eca4c9. * Revert "Test no restart after actor deletion" This reverts commit 114a83de14329aa6ab787c80cd5757cf074a9072. * doc * merge * Revert "Refactor to subscribe to and lookup from worker failure table" This reverts commit 6aa13a05178d0b9aa1db9dee5c978c911b74fa3a. * Revert "Revert "Test no restart after actor deletion"" This reverts commit 1bd92d09172aa8ab42632551cf9c56463f9598fe. * Revert "Revert "parametrize test"" This reverts commit 639ba4d3b02167fb2b05e9878f9aa600bcec95b3. * Revert "Revert "Regression test and logging"" This reverts commit f18b5f0db699a23cbccde32789e3639425e99ca4. * Clean up actors that have gone out of scope * Use actor ID instead of shared_ptr * Clean up actors owned by dead workers * Use actor ID instead of shared_ptr * TODO and lint * Fix unit tests * Add unit tests for supervision and docs * xx * Fix tests * Fix tests * fix build
This commit is contained in:
@@ -699,6 +699,32 @@ def test_use_actor_within_actor(ray_start_10_cpus):
|
||||
assert ray.get(actor2.get_values.remote(5)) == (3, 4)
|
||||
|
||||
|
||||
def test_use_actor_twice(ray_start_10_cpus):
|
||||
# Make sure we can call the same actor using different refs.
|
||||
|
||||
@ray.remote
|
||||
class Actor1:
|
||||
def __init__(self):
|
||||
self.count = 0
|
||||
|
||||
def inc(self):
|
||||
self.count += 1
|
||||
return self.count
|
||||
|
||||
@ray.remote
|
||||
class Actor2:
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
def inc(self, handle):
|
||||
return ray.get(handle.inc.remote())
|
||||
|
||||
a = Actor1.remote()
|
||||
a2 = Actor2.remote()
|
||||
assert ray.get(a2.inc.remote(a)) == 1
|
||||
assert ray.get(a2.inc.remote(a)) == 2
|
||||
|
||||
|
||||
def test_define_actor_within_remote_function(ray_start_10_cpus):
|
||||
# Make sure we can define and actors within remote funtions.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user