[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-4' - test/countloolkits.hpp test/test.cpp wsd/DocumentBroker.hpp wsd/LOOLWSD.cpp

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon May 6 18:06:45 UTC 2019


 test/countloolkits.hpp |    7 +++++++
 test/test.cpp          |    2 +-
 wsd/DocumentBroker.hpp |    2 +-
 wsd/LOOLWSD.cpp        |    6 +++++-
 4 files changed, 14 insertions(+), 3 deletions(-)

New commits:
commit d749765588b8c3fb6577dd2cb2a407cd782dfcc7
Author:     Michael Meeks <michael.meeks at collabora.com>
AuthorDate: Fri May 3 13:51:49 2019 +0100
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Mon May 6 20:06:27 2019 +0200

    Improve pid collection and printout for tests.
    
    Change-Id: I820c1acbdbae41dd2c2c6bb7285b84bbb61e79d5
    Reviewed-on: https://gerrit.libreoffice.org/71772
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
    Tested-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/test/countloolkits.hpp b/test/countloolkits.hpp
index 0f7010ff0..782b19b50 100644
--- a/test/countloolkits.hpp
+++ b/test/countloolkits.hpp
@@ -62,6 +62,13 @@ static int countLoolKitProcesses(const int expected)
         TST_LOG("Found " << count << " LoKit processes but was expecting " << expected << ".");
     }
 
+    std::vector<int> pids = getKitPids();
+    std::ostringstream oss;
+    oss << "Test kit pids are ";
+    for (auto i : pids)
+        oss << i << " ";
+    TST_LOG(oss.str());
+
     return count;
 }
 
diff --git a/test/test.cpp b/test/test.cpp
index 91e3251c7..1dde93600 100644
--- a/test/test.cpp
+++ b/test/test.cpp
@@ -158,7 +158,7 @@ bool runClientTests(bool standalone, bool verbose)
 // Versions assuming a single user, on a single machine
 #ifndef UNIT_CLIENT_TESTS
 
-std::vector<int> getProcPids(const char* exec_filename, bool ignoreZombies = false)
+std::vector<int> getProcPids(const char* exec_filename, bool ignoreZombies = true)
 {
     std::vector<int> pids;
 
diff --git a/wsd/DocumentBroker.hpp b/wsd/DocumentBroker.hpp
index 5f20cdc7a..eeeb97da3 100644
--- a/wsd/DocumentBroker.hpp
+++ b/wsd/DocumentBroker.hpp
@@ -333,7 +333,7 @@ public:
     void childSocketTerminated();
 
     /// Get the PID of the associated child process
-    Poco::Process::PID getPid() const { return _childProcess->getPid(); }
+    Poco::Process::PID getPid() const { return _childProcess ? _childProcess->getPid() : 0; }
 
     std::unique_lock<std::mutex> getLock() { return std::unique_lock<std::mutex>(_mutex); }
     std::unique_lock<std::mutex> getDeferredLock() { return std::unique_lock<std::mutex>(_mutex, std::defer_lock); }
diff --git a/wsd/LOOLWSD.cpp b/wsd/LOOLWSD.cpp
index 1cd9841a5..b520dcba7 100644
--- a/wsd/LOOLWSD.cpp
+++ b/wsd/LOOLWSD.cpp
@@ -3398,7 +3398,11 @@ std::vector<int> LOOLWSD::getKitPids()
     {
         std::unique_lock<std::mutex> lock(DocBrokersMutex);
         for (const auto &it : DocBrokers)
-            pids.push_back(it.second->getPid());
+        {
+            int pid = it.second->getPid();
+            if (pid > 0)
+                pids.push_back(pid);
+        }
     }
     return pids;
 }


More information about the Libreoffice-commits mailing list