Skip to content

Commit 6ef8a32

Browse files
zdevitofacebook-github-bot
authored andcommitted
Back out "fix broken tests" (#751)
Summary: Pull Request resolved: #751 Checks to see if the fix below this in the stack actually works. ghstack-source-id: 300895151 Reviewed By: highker Differential Revision: D79586849 fbshipit-source-id: 41ff8b9d0358968cb3ea2cc90e4c4e5b5a54530f
1 parent 4504d98 commit 6ef8a32

File tree

1 file changed

+7
-47
lines changed

1 file changed

+7
-47
lines changed

python/tests/test_python_actors.py

Lines changed: 7 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,6 @@ async def test_choose():
8585
assert_type(result, int)
8686
assert result2 == result3
8787

88-
await proc.stop()
89-
9088

9189
@pytest.mark.timeout(60)
9290
async def test_stream():
@@ -96,8 +94,6 @@ async def test_stream():
9694

9795
assert 8 == sum([await x for x in v.value.stream()])
9896

99-
await proc.stop()
100-
10197

10298
class To(Actor):
10399
@endpoint
@@ -120,8 +116,6 @@ async def test_mesh_passed_to_mesh():
120116
assert len(all) == 4
121117
assert all[0] != all[1]
122118

123-
await proc.stop()
124-
125119

126120
@pytest.mark.timeout(60)
127121
async def test_mesh_passed_to_mesh_on_different_proc_mesh():
@@ -133,9 +127,6 @@ async def test_mesh_passed_to_mesh_on_different_proc_mesh():
133127
assert len(all) == 4
134128
assert all[0] != all[1]
135129

136-
await proc.stop()
137-
await proc2.stop()
138-
139130

140131
@pytest.mark.timeout(60)
141132
async def test_actor_slicing():
@@ -152,9 +143,6 @@ async def test_actor_slicing():
152143

153144
assert result[0] == result[1]
154145

155-
await proc.stop()
156-
await proc2.stop()
157-
158146

159147
@pytest.mark.timeout(60)
160148
async def test_aggregate():
@@ -165,8 +153,6 @@ async def test_aggregate():
165153
r = await acc.accumulate()
166154
assert r == 4
167155

168-
await proc.stop()
169-
170156

171157
class RunIt(Actor):
172158
@endpoint
@@ -184,8 +170,6 @@ async def test_rank_size():
184170
assert 1 == await acc.accumulate(lambda: current_rank()["gpus"])
185171
assert 4 == await acc.accumulate(lambda: current_size()["gpus"])
186172

187-
await proc.stop()
188-
189173

190174
class SyncActor(Actor):
191175
@endpoint
@@ -201,51 +185,41 @@ async def test_sync_actor():
201185
r = await a.sync_endpoint.choose(c)
202186
assert r == 5
203187

204-
await proc.stop()
205-
206188

207189
@pytest.mark.timeout(60)
208-
async def test_sync_actor_sync_client() -> None:
190+
def test_sync_actor_sync_client() -> None:
209191
proc = local_proc_mesh(gpus=2)
210192
a = proc.spawn("actor", SyncActor).get()
211193
c = proc.spawn("counter", Counter, 5).get()
212194
r = a.sync_endpoint.choose(c).get()
213195
assert r == 5
214196

215-
await proc.stop()
216-
217197

218198
@pytest.mark.timeout(60)
219-
async def test_proc_mesh_size() -> None:
199+
def test_proc_mesh_size() -> None:
220200
proc = local_proc_mesh(gpus=2)
221201
assert 2 == proc.size("gpus")
222-
# proc.initialized.get()
223-
# await proc.stop()
224202

225203

226204
@pytest.mark.timeout(60)
227-
async def test_rank_size_sync() -> None:
205+
def test_rank_size_sync() -> None:
228206
proc = local_proc_mesh(gpus=2)
229207
r = proc.spawn("runit", RunIt).get()
230208

231209
acc = Accumulator(r.run, 0, operator.add)
232210
assert 1 == acc.accumulate(lambda: current_rank()["gpus"]).get()
233211
assert 4 == acc.accumulate(lambda: current_size()["gpus"]).get()
234212

235-
await proc.stop()
236-
237213

238214
@pytest.mark.timeout(60)
239-
async def test_accumulate_sync() -> None:
215+
def test_accumulate_sync() -> None:
240216
proc = local_proc_mesh(gpus=2)
241217
counter = proc.spawn("counter", Counter, 1).get()
242218
counter.incr.broadcast()
243219
acc = Accumulator(counter.value, 0, operator.add)
244220
r = acc.accumulate().get()
245221
assert r == 4
246222

247-
await proc.stop()
248-
249223

250224
class CastToCounter(Actor):
251225
@endpoint
@@ -254,7 +228,7 @@ def doit(self, c: Counter):
254228

255229

256230
@pytest.mark.timeout(60)
257-
async def test_value_mesh() -> None:
231+
def test_value_mesh() -> None:
258232
proc = local_proc_mesh(gpus=2)
259233
counter = proc.spawn("counter", Counter, 0).get()
260234
counter.slice(hosts=0, gpus=1).incr.broadcast()
@@ -265,8 +239,6 @@ async def test_value_mesh() -> None:
265239
n = proc.spawn("ctc", CastToCounter).get()
266240
assert list(x) == n.slice(gpus=0).doit.call_one(counter).get()
267241

268-
await proc.stop()
269-
270242

271243
@pytest.mark.timeout(60)
272244
def test_rust_binding_modules_correct() -> None:
@@ -333,8 +305,6 @@ async def test_actor_tls() -> None:
333305
assert 4 == await am.get.call_one()
334306
assert 4 == await am.get_async.call_one()
335307

336-
await pm.stop()
337-
338308

339309
class TLSActorFullSync(Actor):
340310
"""An actor that manages thread-local state."""
@@ -364,8 +334,6 @@ async def test_actor_tls_full_sync() -> None:
364334

365335
assert 4 == await am.get.call_one()
366336

367-
await pm.stop()
368-
369337

370338
class AsyncActor(Actor):
371339
def __init__(self):
@@ -392,8 +360,6 @@ async def test_async_concurrency():
392360
await am.no_more.call()
393361
await fut
394362

395-
await pm.stop()
396-
397363

398364
async def awaitit(f):
399365
return await f
@@ -755,7 +721,7 @@ async def send(self, port: Port[int]):
755721

756722

757723
@pytest.mark.timeout(60)
758-
async def test_port_as_argument() -> None:
724+
def test_port_as_argument() -> None:
759725
proc_mesh = local_proc_mesh(gpus=1)
760726
s = proc_mesh.spawn("send_alot", SendAlot).get()
761727
send, recv = Channel[int].open()
@@ -765,8 +731,6 @@ async def test_port_as_argument() -> None:
765731
for i in range(100):
766732
assert i == recv.recv().get()
767733

768-
await proc_mesh.stop()
769-
770734

771735
@pytest.mark.timeout(15)
772736
async def test_same_actor_twice() -> None:
@@ -783,8 +747,6 @@ async def test_same_actor_twice() -> None:
783747
"gspawn failed: an actor with name 'dup' has already been spawned" in error_msg
784748
), f"Expected error message about duplicate actor name, got: {error_msg}"
785749

786-
await pm.stop()
787-
788750

789751
class TestActorMeshStop(unittest.IsolatedAsyncioTestCase):
790752
async def test_actor_mesh_stop(self) -> None:
@@ -811,13 +773,11 @@ def add(self, port: "Port[int]", b: int) -> None:
811773

812774

813775
@pytest.mark.timeout(60)
814-
async def test_ported_actor():
776+
def test_ported_actor():
815777
proc_mesh = local_proc_mesh(gpus=1).get()
816778
a = proc_mesh.spawn("port_actor", PortedActor).get()
817779
assert 5 == a.add.call_one(2).get()
818780

819-
await proc_mesh.stop()
820-
821781

822782
async def _recv():
823783
return (7, 2, 3)

0 commit comments

Comments
 (0)