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 <ashod.nakashian@collabora.co.uk>
pull/8916/head
Ashod Nakashian 2024-04-27 07:02:12 -04:00 committed by Michael Meeks
parent b38e1f41ea
commit 7268248481
1 changed files with 7 additions and 0 deletions

View File

@ -11,6 +11,7 @@
#pragma once
#include "Unit.hpp"
#include <test/lokassert.hpp>
#include <test/testlog.hpp>
@ -572,6 +573,12 @@ connectLOKit(const std::shared_ptr<SocketPoll>& 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());
}