Mend UnitPrefork.
Count pre-forked processes more correctly. Use Unit's returnValue implementation to fix failure exit codes. Accept new loolwsd.log socket as being authentic.
This commit is contained in:
parent
fd1991a961
commit
d3daa2d9d9
2 changed files with 3 additions and 12 deletions
|
@ -164,6 +164,7 @@ void UnitBase::exitTest(TestResult result)
|
|||
|
||||
void UnitBase::timeout()
|
||||
{
|
||||
Log::error("Timed out waiting for unit test to complete");
|
||||
exitTest(TestResult::TEST_TIMED_OUT);
|
||||
}
|
||||
|
||||
|
|
|
@ -50,17 +50,6 @@ public:
|
|||
setHasKitHooks();
|
||||
}
|
||||
|
||||
virtual void returnValue(int &retValue) override
|
||||
{
|
||||
// 0 when empty (success), otherwise failure.
|
||||
if (!_failure.empty())
|
||||
{
|
||||
Log::error("UnitPrefork failed due to: " + _failure);
|
||||
}
|
||||
|
||||
retValue = !_failure.empty();
|
||||
}
|
||||
|
||||
virtual void preSpawnCount(int &numPrefork) override
|
||||
{
|
||||
numPrefork = NumToPrefork;
|
||||
|
@ -111,7 +100,7 @@ public:
|
|||
virtual void newChild(const std::shared_ptr<Poco::Net::WebSocket> &socket) override
|
||||
{
|
||||
_childSockets.push_back(socket);
|
||||
if (_childSockets.size() > NumToPrefork)
|
||||
if (_childSockets.size() >= NumToPrefork)
|
||||
{
|
||||
Poco::Timestamp::TimeDiff elapsed = _startTime.elapsed();
|
||||
|
||||
|
@ -260,6 +249,7 @@ public:
|
|||
else if (extDot && !strcmp(extDot, ".rdb"))
|
||||
rdbCount++;
|
||||
else if (strstr(buffer, "unit-prefork.log") || // our log
|
||||
strstr(buffer, "loolwsd.log") || // debug log
|
||||
(strstr(buffer, "/proc/") && // our readdir
|
||||
strstr(buffer, "/fd")))
|
||||
; // ignore
|
||||
|
|
Loading…
Reference in a new issue