From 7268248481f598afd46bca612b0ef3ddda84b0d1 Mon Sep 17 00:00:00 2001 From: Ashod Nakashian Date: Sat, 27 Apr 2024 07:02:12 -0400 Subject: [PATCH] wsd: test: give up attempting to connect if the test finished Some tests are designed to exercise the reconnection logic. Once the test validates that the correct reconnection logic is used, the test is considered finished. In those cases, we need to break the test framework's retry logic. Change-Id: Ie0bb5dcc430a954910c2af4817a500f5b576bd4c Signed-off-by: Ashod Nakashian --- test/helpers.hpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/helpers.hpp b/test/helpers.hpp index 333c63055d..de87a2af74 100644 --- a/test/helpers.hpp +++ b/test/helpers.hpp @@ -11,6 +11,7 @@ #pragma once +#include "Unit.hpp" #include #include @@ -572,6 +573,12 @@ connectLOKit(const std::shared_ptr& socketPoll, const Poco::URI& uri break; } + if (UnitBase::get().isFinished()) + { + TST_LOG("The test has finished, giving up connectLOKit"); + break; + } + TST_LOG("ERROR: Reconnecting (retry #" << (max_retries - retries) << ") to " << uri.toString()); }