@@ -33,8 +33,8 @@ def test_runtime_boot(
3333):
3434 '''
3535 Verify we can boot the `pikerd` service stack using the
36- `open_test_pikerd` fixture helper and that registry address details
37- match up.
36+ `open_test_pikerd() ` fixture helper and that contact- registry
37+ address details match up.
3838
3939 '''
4040 async def main ():
@@ -55,6 +55,9 @@ async def main():
5555 assert pikerd_portal .channel .raddr == daemon_addr
5656 assert pikerd_portal .channel .raddr == portal .channel .raddr
5757
58+ # no service tasks should be started
59+ assert not services .service_tasks
60+
5861 trio .run (main )
5962
6063
@@ -121,8 +124,7 @@ def test_ensure_ems_in_paper_actors(
121124 async def main ():
122125
123126 # type declares
124- book : OrderClient
125- trades_stream : tractor .MsgStream
127+ client : OrderClient
126128 pps : dict [str , list [BrokerdPosition ]]
127129 accounts : list [str ]
128130 dialogs : dict [str , Status ]
@@ -139,8 +141,8 @@ async def main():
139141 mode = 'paper' ,
140142 loglevel = loglevel ,
141143 ) as (
142- book ,
143- trades_stream ,
144+ client ,
145+ _ , # trades_stream: tractor.MsgStream
144146 pps ,
145147 accounts ,
146148 dialogs ,
@@ -152,6 +154,9 @@ async def main():
152154 assert not pps
153155 assert not dialogs
154156
157+ assert not client ._sent_orders
158+ assert accounts
159+
155160 pikerd_subservices = ['emsd' , 'samplerd' ]
156161
157162 async with (
@@ -169,10 +174,13 @@ async def main():
169174 print ('ALL SERVICES STARTED, terminating..' )
170175 await services .cancel_service ('emsd' )
171176
177+ # ensure we receive a remote cancellation error caused by the
178+ # pikerd root actor since we used the `.cancel_service()` API
179+ # above B)
172180 with pytest .raises (
173181 tractor ._exceptions .ContextCancelled ,
174182 ) as exc_info :
175183 trio .run (main )
176184
177- cancel_msg : str = '_emsd_main()` was remotely cancelled by its caller'
178- assert cancel_msg in exc_info .value .args [0 ]
185+ cancelled_msg : str = " was remotely cancelled by remote actor ( \' pikerd \' "
186+ assert cancelled_msg in exc_info .value .args [0 ]
0 commit comments