wsd: more time to count lool processes

In unittests we need to count the
number of lool processes. This can
take a long time depending on how many
they are and if they are exiting or
new ones being created.

New logic is to reset the timeout
when the numbers are changing until
it settles on either the expected
(when we return), or some other value.

Change-Id: Ia8fcc7ef60586ebec6d8a280174b4dd2eae0ccc4
Reviewed-on: https://gerrit.libreoffice.org/33672
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
This commit is contained in:
Ashod Nakashian
2017-01-29 14:04:54 -05:00
committed by Ashod Nakashian
parent 78fdcb903a
commit 9a8fe7054a

View File

@ -100,7 +100,13 @@ static int countLoolKitProcesses(const int expected)
// Give polls in the lool processes time to time out etc // Give polls in the lool processes time to time out etc
std::this_thread::sleep_for(std::chrono::milliseconds(sleepMs)); std::this_thread::sleep_for(std::chrono::milliseconds(sleepMs));
count = getLoolKitProcessCount(); const auto newCount = getLoolKitProcessCount();
if (count != newCount)
{
// Allow more time until the number settles.
i = 0;
count = newCount;
}
} }
std::cerr << std::endl; std::cerr << std::endl;