File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -357,3 +357,32 @@ async def test_proc_mesh_monitoring():
357
357
assert isinstance (event , ProcEvent .Crashed )
358
358
assert event [0 ] == 0 # check rank
359
359
assert "fail on init" in event [1 ] # check error message
360
+
361
+
362
+ class Worker (Actor ):
363
+ @endpoint
364
+ def work (self ):
365
+ raise ValueError ("value error" )
366
+
367
+
368
+ class Manager (Actor ):
369
+ @endpoint
370
+ async def init (self ):
371
+ mesh = await proc_mesh (gpus = 1 )
372
+ self .workers = await mesh .spawn ("Worker" , Worker )
373
+
374
+ @endpoint
375
+ async def route (self ):
376
+ return await self .workers .work .call_one ()
377
+
378
+
379
+ @pytest .mark .asyncio
380
+ async def test_errors_propagated ():
381
+ p_mesh = await proc_mesh (gpus = 1 )
382
+ mesh = await p_mesh .spawn ("manager" , Manager )
383
+
384
+ await mesh .init .call_one ()
385
+
386
+ with pytest .raises (ActorError ) as err_info :
387
+ await mesh .route .call_one ()
388
+ assert "value error" in str (err_info .value )
You can’t perform that action at this time.
0 commit comments