test/UnitLoad.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) New commits: commit 5bf3fc86be481a1b8b8d7ed54187a4a2a6833b34 Author: Miklos Vajna <vmik...@collabora.com> AuthorDate: Thu Dec 5 08:48:26 2019 +0100 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Thu Dec 5 08:48:32 2019 +0100
test: fix UnitLoad::testConnectNoLoad() Depending on timing, this failed with the following error: wsd-14400-14411 [ docbroker_001 ] WRN Will not load document marked to destroy. DocKey: [/tmp/connectNoLoad_27c61e41_hello.odt].| wsd/DocumentBroker.cpp:520 Make sure we don't try to load the same document again when the cleanup for the previous session is not done yet. Change-Id: I354999fa934df665b48dca314d2b77ab95c84ec0 diff --git a/test/UnitLoad.cpp b/test/UnitLoad.cpp index bb549b732..2e5ec24ea 100644 --- a/test/UnitLoad.cpp +++ b/test/UnitLoad.cpp @@ -17,6 +17,8 @@ #include <Poco/URI.h> #include <cppunit/TestAssert.h> +#include <wsd/DocumentBroker.hpp> +#include <wsd/LOOLWSD.hpp> #include <Unit.hpp> #include <helpers.hpp> @@ -79,6 +81,14 @@ UnitBase::TestResult UnitLoad::testConnectNoLoad() TST_LOG_NAME(testname1, "Disconnecting first."); socket.reset(); + std::vector<std::shared_ptr<DocumentBroker>> brokers = LOOLWSD::getBrokersTestOnly(); + if (!brokers.empty() && !brokers[0]->isMarkedToDestroy()) + { + // Give the document broker thread time, so it can clean up, so the next load won't fail + // (sometimes), because a cleanup is in progress. + sleep(1); + } + // Connect and load first view. TST_LOG_NAME(testname2, "Connecting second to load first view."); std::shared_ptr<LOOLWebSocket> socket1 _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits