[Libreoffice-commits] online.git: test/httpcrashtest.cpp wsd/LOOLWSD.cpp

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sat May 4 22:04:19 UTC 2019


 test/httpcrashtest.cpp |    3 +++
 wsd/LOOLWSD.cpp        |    4 ++++
 2 files changed, 7 insertions(+)

New commits:
commit 264450758a42464dd7181214f26fd46d256371b6
Author:     Michael Meeks <michael.meeks at collabora.com>
AuthorDate: Sat May 4 22:50:00 2019 +0100
Commit:     Michael Meeks <michael.meeks at collabora.com>
CommitDate: Sun May 5 00:04:00 2019 +0200

    test: close testCrashKit race.
    
    LOOLWSD is conservative and leaves forkit to start processes for a
    while. If we kill a kit before it has started and registered we can
    end up with LOOLWSD holding off to wait for the (now dead) kit, and
    the tearDown assertions that we have 1 kit failing.
    
    Change-Id: Id25e48bf55d1757d2223816293500fde6ff9df1b
    Reviewed-on: https://gerrit.libreoffice.org/71811
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
    Tested-by: Michael Meeks <michael.meeks at collabora.com>

diff --git a/test/httpcrashtest.cpp b/test/httpcrashtest.cpp
index a2b1a9d2a..6fd8ee938 100644
--- a/test/httpcrashtest.cpp
+++ b/test/httpcrashtest.cpp
@@ -136,6 +136,9 @@ void HTTPCrashTest::testCrashKit()
     {
         std::shared_ptr<LOOLWebSocket> socket = loadDocAndGetSocket("empty.odt", _uri, testname);
 
+        TST_LOG("Allowing time for kits to spawn and connect to wsd to get cleanly killed");
+        std::this_thread::sleep_for(std::chrono::milliseconds(1000));
+
         TST_LOG("Killing loolkit instances.");
 
         killLoKitProcesses();
diff --git a/wsd/LOOLWSD.cpp b/wsd/LOOLWSD.cpp
index 81447db4d..a622607d5 100644
--- a/wsd/LOOLWSD.cpp
+++ b/wsd/LOOLWSD.cpp
@@ -361,6 +361,7 @@ void cleanupDocBrokers()
 /// -1 for error.
 static int forkChildren(const int number)
 {
+    LOG_TRC("Request forkit to spawn " << number << " new child(ren)");
     Util::assertIsLocked(NewChildrenMutex);
 
     if (number > 0)
@@ -1490,6 +1491,9 @@ void LOOLWSD::autoSave(const std::string& docKey)
 void PrisonerPoll::wakeupHook()
 {
 #if !MOBILEAPP
+    LOG_TRC("PrisonerPoll - wakes up with " << NewChildren.size() <<
+            " new children and " << DocBrokers.size() << " brokers and " <<
+            OutstandingForks << " kits forking");
     if (!LOOLWSD::checkAndRestoreForKit())
     {
         // No children have died.


More information about the Libreoffice-commits mailing list