From 954cd6adcaa4c333a14ae3684b161502ea52eea4 Mon Sep 17 00:00:00 2001 From: cthuang Date: Tue, 16 Mar 2021 13:55:41 +0000 Subject: [PATCH] TUN-4091: Use flaky decorator to rerun reconnect component tests when they fail --- component-tests/requirements.txt | 1 + component-tests/test_reconnect.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/component-tests/requirements.txt b/component-tests/requirements.txt index e5aa3eab..edd3e1f4 100644 --- a/component-tests/requirements.txt +++ b/component-tests/requirements.txt @@ -1,3 +1,4 @@ +flaky==3.7.0 pytest==6.2.2 pyyaml==5.4.1 requests==2.25.1 diff --git a/component-tests/test_reconnect.py b/component-tests/test_reconnect.py index 44e27e3f..547dd476 100644 --- a/component-tests/test_reconnect.py +++ b/component-tests/test_reconnect.py @@ -1,12 +1,13 @@ #!/usr/bin/env python import copy - +from flaky import flaky from retrying import retry from time import sleep from util import start_cloudflared, wait_tunnel_ready, check_tunnel_not_connected, send_requests +@flaky(max_runs=3, min_passes=1) class TestReconnect(): default_ha_conns = 4 default_reconnect_secs = 5