Consume whole queue before considering skill done
This will handle any extra messages after the skill complete message was detected. For example messages from certain fallback skills
@@ -264,6 +264,7 @@ class SkillTest(object):
self.returned_intent = False
self.test_status = test_status
self.failure_msg = None
+ self.end_of_skill = False
def run(self, loader):
""" Execute the test
@@ -277,6 +278,8 @@ class SkillTest(object):
Args:
bool: Test results -- only True if all passed
"""
+ self.end_of_skill = False # Reset to false at beginning of test
+
s = [s for s in loader.skills if s and s.root_dir == self.skill]
if s:
s = s[0]
@@ -465,9 +468,13 @@ class SkillTest(object):
evaluation_rule.evaluate(event.data)
if event.msg_type == 'mycroft.skill.handler.complete':
- return True
+ self.end_of_skill = True
except Empty:
pass
+
+ if q.empty() and self.end_of_skill:
+ return True
+ else:
return False
def shutdown_emitter(self, s):
