diff options
author | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2023-02-25 21:52:40 -0500 |
---|---|---|
committer | Ashod Nakashian <Ashod@users.noreply.github.com> | 2023-03-10 07:45:12 -0500 |
commit | d0ed6cd3d228a1b623163110116105556f2041e8 (patch) | |
tree | b85ffad450930df978aa5dfbe2f6327310a1a453 /common/Unit.cpp | |
parent | wsd: not an error to not support storage locking (diff) | |
download | online-d0ed6cd3d228a1b623163110116105556f2041e8.tar.gz online-d0ed6cd3d228a1b623163110116105556f2041e8.zip |
wsd: test: do not start the next test if test is not finished
Change-Id: Ibdcf66f9a037f6b4e2e575cb61fe1459c912e44f
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Diffstat (limited to 'common/Unit.cpp')
-rw-r--r-- | common/Unit.cpp | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/common/Unit.cpp b/common/Unit.cpp index c2da4eac34..3f57e363a2 100644 --- a/common/Unit.cpp +++ b/common/Unit.cpp @@ -583,6 +583,11 @@ void UnitWSD::DocBrokerDestroy(const std::string& key) if (isUnitTesting()) { onDocBrokerDestroy(key); + if (!isFinished()) + { + // Not yet finished; don't start the next test just yet. + return; + } // We could be called from either a SocketPoll (websrv_poll) // or from invokeTest (coolwsd main). @@ -595,24 +600,23 @@ void UnitWSD::DocBrokerDestroy(const std::string& key) ++GlobalIndex; filter(); - // Clear the shortcuts. - GlobalKit = nullptr; - GlobalWSD = nullptr; - GlobalTool = nullptr; + // Clear the shortcuts. + GlobalKit = nullptr; + GlobalWSD = nullptr; + GlobalTool = nullptr; - if (GlobalArray[GlobalIndex] != nullptr) - { - rememberInstance(_type, GlobalArray[GlobalIndex]); + if (GlobalArray[GlobalIndex] != nullptr) + { + rememberInstance(_type, GlobalArray[GlobalIndex]); - LOG_TST("Starting test #" << GlobalIndex + 1 << ": " - << GlobalArray[GlobalIndex]->getTestname()); - if (GlobalWSD) - GlobalWSD->configure(Poco::Util::Application::instance().config()); - GlobalArray[GlobalIndex]->initialize(); + LOG_TST("Starting test #" << GlobalIndex + 1 << ": " + << GlobalArray[GlobalIndex]->getTestname()); + if (GlobalWSD) + GlobalWSD->configure(Poco::Util::Application::instance().config()); + GlobalArray[GlobalIndex]->initialize(); // Wake-up so the previous test stops. SocketPoll::wakeupWorld(); - return; } } } |