From a6d1e91942943d0aebc4f2c638bd7e2be075ba45 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=85ke=20Forslund?= <ake.forslund@gmail.com>
Date: Tue, 17 Mar 2020 15:02:13 +0100
Subject: [PATCH] Add auto-retry

This switches behave to the current dev release including the autoretry
system.
---
 test-requirements.txt                                       | 2 +-
 test/integrationtests/voight_kampff/features/environment.py | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/test-requirements.txt b/test-requirements.txt
index dca9a4b830..874a0f130d 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -5,5 +5,5 @@ pytest-cov==2.8.1
 cov-core==1.15.0
 sphinx==2.2.1
 sphinx-rtd-theme==0.4.3
-behave==1.2.6
+git+https://github.com/behave/behave@v1.2.7.dev1
 allure-behave==2.8.10
diff --git a/test/integrationtests/voight_kampff/features/environment.py b/test/integrationtests/voight_kampff/features/environment.py
index bf517477d4..fa1d870110 100644
--- a/test/integrationtests/voight_kampff/features/environment.py
+++ b/test/integrationtests/voight_kampff/features/environment.py
@@ -15,6 +15,7 @@
 import logging
 from threading import Event, Lock
 from time import sleep, monotonic
+from behave.contrib.scenario_autoretry import patch_scenario_with_autoretry
 
 from msm import MycroftSkillsManager
 from mycroft.audio import wait_while_speaking
@@ -95,6 +96,8 @@ def before_all(context):
 
 def before_feature(context, feature):
     context.log.info('Starting tests for {}'.format(feature.name))
+    for scenario in feature.scenarios:
+        patch_scenario_with_autoretry(scenario, max_attempts=2)
 
 
 def after_all(context):