Skip to content

Commit fe1dcbc

Browse files
samluryefacebook-github-bot
authored andcommitted
Fix broken tests (#951)
Summary: Pull Request resolved: #951 D80505166 broke some tests. We need to provide a python implementation for `Instance.proc_id`. Additionally, there was a bad assert about `_controller_controller` not being none; we need to handle the case where the `_Actor` being initialized is `_ControllerController`. ghstack-source-id: 304712948 exported-using-ghexport Reviewed By: zdevito Differential Revision: D80725768 fbshipit-source-id: b64dff2b3b17ab1f2fdcab9c563f2e85bbc1750b
1 parent 296eb22 commit fe1dcbc

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

python/monarch/_src/actor/actor_mesh.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def proc_id(self) -> str:
134134
"""
135135
The proc_id of the current actor.
136136
"""
137-
...
137+
return self.actor_id.proc_id
138138

139139
@property
140140
def actor_id(self) -> ActorId:
@@ -775,6 +775,12 @@ async def handle(
775775
match method:
776776
case MethodSpecifier.Init():
777777
Class, self._proc_mesh, self._controller_controller, *args = args
778+
if self._controller_controller is not None:
779+
ctx.actor_instance._controller_controller = (
780+
self._controller_controller
781+
)
782+
assert self._proc_mesh is not None
783+
ctx.actor_instance.proc_mesh = self._proc_mesh
778784
try:
779785
self.instance = Class(*args, **kwargs)
780786
except Exception as e:
@@ -808,8 +814,8 @@ async def handle(
808814
f" This is likely due to an earlier error: {self._saved_error}"
809815
)
810816
raise AssertionError(error_message)
811-
assert self._controller_controller is not None
812-
ctx.actor_instance._controller_controller = self._controller_controller
817+
if self._controller_controller is not None:
818+
ctx.actor_instance._controller_controller = self._controller_controller
813819
assert self._proc_mesh is not None
814820
ctx.actor_instance.proc_mesh = self._proc_mesh
815821
the_method = getattr(self.instance, method_name)

0 commit comments

Comments
 (0)