Skip to content

Commit

Permalink
HTTPCrashTest::testCrashForkit can timeout while forkit is still rest…
Browse files Browse the repository at this point in the history
…arting

under high load with a -O0 debug online build and dbgutil core build

Signed-off-by: Caolán McNamara <[email protected]>
Change-Id: Id740772ac421f6c29594a5ded26573d71f8d39b3
  • Loading branch information
caolanm authored and Ashod committed Dec 12, 2024
1 parent e50cb36 commit 977fd01
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions test/httpcrashtest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@

using namespace helpers;

// The default is KIT_PID_TIMEOUT_MS, but we may have to wait for coolforkit to restart, which
// may take up to the default CHILD_SPAWN_TIMEOUT_MS which is larger than KIT_PID_TIMEOUT_MS
const std::chrono::milliseconds timeoutMs = std::chrono::milliseconds(KIT_PID_TIMEOUT_MS + CHILD_SPAWN_TIMEOUT_MS);

/// Tests the HTTP WebSocket API of coolwsd. The server has to be started manually before running this test.
class HTTPCrashTest : public CPPUNIT_NS::TestFixture
{
Expand Down Expand Up @@ -96,9 +100,6 @@ class HTTPCrashTest : public CPPUNIT_NS::TestFixture
{
_socketPoll->joinThread();
resetTestStartTime();
// The default is KIT_PID_TIMEOUT_MS, but we may have to wait for coolforkit to restart, which
// may take up to the default CHILD_SPAWN_TIMEOUT_MS which is larger than KIT_PID_TIMEOUT_MS
const std::chrono::milliseconds timeoutMs = std::chrono::milliseconds(KIT_PID_TIMEOUT_MS + CHILD_SPAWN_TIMEOUT_MS);
waitForKitPidsReady("tearDown", timeoutMs);
resetTestStartTime();
}
Expand Down Expand Up @@ -231,7 +232,7 @@ void HTTPCrashTest::testCrashForkit()
helpers::killAllKitProcesses(testname);

// Forkit should restart
waitForKitPidsReady(testname);
waitForKitPidsReady(testname, timeoutMs);

TST_LOG("Communicating after kill.");
socket = loadDocAndGetSession(_socketPoll, "empty.odt", _uri, testname);
Expand Down

0 comments on commit 977fd01

Please sign in to comment.