@@ -67,22 +67,12 @@ def wait_for_n_messages(n):
67
67
"recognizer_loop:utterance" ,
68
68
# global stop trigger
69
69
"mycroft.stop" ,
70
- # intent pipelines
71
- "common_query.openvoiceos.stop" ,
72
- "common_query.openvoiceos.stop.response" , # reporting nothing to stop
73
- "ovos.common_play.stop" ,
74
- "ovos.common_play.stop.response" , # reporting nothing to stop
75
-
76
- # skill reporting
77
- f"{ self .skill_id } .stop" , # internal, @killable_events
78
- f"{ self .skill_id } .stop.response" , # skill reporting nothing to stop
79
-
70
+ "common_query.openvoiceos.stop.response" ,
71
+ "ovos.common_play.stop.response" ,
72
+ f"{ self .skill_id } .stop.response" ,
80
73
# sanity check in test skill that method was indeed called
81
74
"speak" , # "utterance":"old stop called"
82
-
83
- # NOTE: messages below might show up before enclosure.active_skill
84
- f"{ self .new_skill_id } .stop" , # internal, @killable_events
85
- f"{ self .new_skill_id } .stop.response" , # skill reporting nothing to stop
75
+ f"{ self .new_skill_id } .stop.response" , # nothing to stop
86
76
87
77
"ovos.utterance.handled"
88
78
]
@@ -151,30 +141,17 @@ def wait_for_n_messages(n):
151
141
f"{ self .skill_id } .stop.ping" , # check if active skill wants to stop
152
142
"skill.stop.pong" , # "can_handle":true
153
143
f"{ self .skill_id } .stop" , # skill specific stop trigger
154
- f"{ self .skill_id } .stop.response" , # skill fails to stop (old style)
144
+ "speak" , # "old stop called" in the test skill stop method
145
+ f"{ self .skill_id } .stop.response" , # skill stops and reports back
155
146
156
- # stop medium
157
- f"{ self .skill_id } .stop.ping" ,
158
- "skill.stop.pong" ,
159
- f"{ self .skill_id } .stop" , # skill specific stop trigger
160
- f"{ self .skill_id } .stop.response" , # skill fails to stop (old style)
147
+ # skill reports it stopped, so core ensures any threaded activity is also killed
148
+ "mycroft.skills.abort_question" , # core kills any ongoing get_response
149
+ "ovos.skills.converse.force_timeout" , # core kills any ongoing converse
150
+ "mycroft.audio.speech.stop" , # core kills any ongoing TTS
161
151
162
- # stop fallback
163
- "mycroft.stop" , # global stop for backwards compat
164
- f"{ self .skill_id } .stop" ,
165
- f"{ self .skill_id } .stop.response" , # apparently fails to stop (old style)
166
-
167
- # test in skill that global stop was called
168
- "speak" , # "utterance":"stop"
169
-
170
- # report old-style stop handled event
171
- "mycroft.stop.handled" , # {"by":"skill:skill-old-stop.openvoiceos"}
152
+ f"{ self .skill_id } .activate" , # update of skill last usage timestamp
153
+ "ovos.utterance.handled"
172
154
173
- # old style unwanted side effects (global stop is global)
174
- f"{ self .new_skill_id } .stop" ,
175
- f"{ self .new_skill_id } .stop.response" ,
176
- # other test skill also speaks
177
- "speak" # "utterance":"old stop called"
178
155
]
179
156
180
157
wait_for_n_messages (len (expected_messages ))
@@ -246,14 +223,15 @@ def wait_for_n_messages(n):
246
223
"recognizer_loop:utterance" ,
247
224
# global stop trigger
248
225
"mycroft.stop" ,
249
- f"{ self .skill_id } .stop" , # internal, @killable_events
226
+ "common_query.openvoiceos.stop.response" , # common_query framework reporting nothing to stop
227
+ "ovos.common_play.stop.response" , # OCP framework reporting nothing to stop
250
228
f"{ self .skill_id } .stop.response" , # skill reporting nothing to stop
251
- f"{ self .new_skill_id } .stop" , # internal, @killable_events
252
- f"{ self .new_skill_id } .stop.response" , # skill reporting nothing to stop
253
229
254
230
# sanity check in test skill that method was indeed called
255
231
"speak" , # "utterance":"old stop called"
256
232
233
+ f"{ self .new_skill_id } .stop.response" , # skill reporting it stopped
234
+
257
235
"ovos.utterance.handled" ,
258
236
259
237
]
@@ -331,8 +309,11 @@ def wait_for_n_messages(n):
331
309
332
310
# test session specific stop was called
333
311
"speak" , # "utterance":"stop 123"
334
-
335
312
f"{ self .new_skill_id } .stop.response" , # skill reports it stopped (new style),
313
+
314
+ "mycroft.skills.abort_question" , # core kills any ongoing get_response
315
+ "ovos.skills.converse.force_timeout" , # core kills any ongoing converse
316
+ "mycroft.audio.speech.stop" , # core kills any ongoing TTS
336
317
f"{ self .new_skill_id } .activate" , # update timestamp of last interaction with skill
337
318
"ovos.utterance.handled" # handle_utterance returned (intent service)
338
319
]
@@ -350,7 +331,7 @@ def wait_for_n_messages(n):
350
331
self .assertEqual (m .data ["utterance" ], "stop 123" )
351
332
352
333
# confirm "skill-new-stop" was the one that reported success
353
- handler = messages [- 3 ]
334
+ handler = messages [- 6 ]
354
335
self .assertEqual (handler .msg_type , f"{ self .new_skill_id } .stop.response" )
355
336
self .assertEqual (handler .data ["result" ], True )
356
337
@@ -373,24 +354,27 @@ def wait_for_n_messages(n):
373
354
f"{ self .new_skill_id } .stop.ping" , # check if active skill wants to stop
374
355
"skill.stop.pong" , # "can_handle":true
375
356
f"{ self .new_skill_id } .stop" , # skill specific stop trigger
357
+ "speak" , # it's in the stop method even if it returns False!
376
358
f"{ self .new_skill_id } .stop.response" , # dont want to stop (new style)
377
359
378
360
# rest of pipeline
379
361
# stop low
380
362
f"{ self .new_skill_id } .stop.ping" ,
381
363
"skill.stop.pong" ,
382
364
f"{ self .new_skill_id } .stop" , # skill specific stop trigger
365
+ "speak" , # it's in the stop method even if it returns False!
383
366
f"{ self .new_skill_id } .stop.response" , # dont want to stop (new style)
384
367
385
368
# global stop fallback
386
369
"mycroft.stop" ,
387
- f"{ self .skill_id } .stop" , # skill specific stop trigger
370
+ "common_query.openvoiceos.stop.response" , # dont want to stop
371
+ "ovos.common_play.stop.response" , # dont want to stop
372
+
388
373
f"{ self .skill_id } .stop.response" , # old style, never stops
389
- f" { self . new_skill_id } .stop " , # skill specific stop trigger
390
- f"{ self .skill_id } .stop.response" , # dont want to stop (new style)
374
+ "speak " , # it's in the stop method even if it returns False!
375
+ f"{ self .new_skill_id } .stop.response" , # dont want to stop (new style)
391
376
392
- # check the global stop handlers are called
393
- "speak" , # "utterance":"old stop called"
377
+ "ovos.utterance.handled"
394
378
]
395
379
396
380
wait_for_n_messages (len (expected_messages ))
0 commit comments