diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2017-03-31 16:00:32 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2017-03-31 16:00:32 +0100 |
commit | 68bbd40bdc6626061b4d7fc7569fc7622f2bbb4d (patch) | |
tree | 29090009443f7be7f138bc4e8708b548aa61becc | |
parent | Tests: enable tilecache test and bin socket buffer size test. (diff) | |
download | online-68bbd40bdc6626061b4d7fc7569fc7622f2bbb4d.tar.gz online-68bbd40bdc6626061b4d7fc7569fc7622f2bbb4d.zip |
UnitTimeout: repair unit test timeout fidelity.
-rw-r--r-- | test/Makefile.am | 2 | ||||
-rw-r--r-- | wsd/LOOLWSD.cpp | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/test/Makefile.am b/test/Makefile.am index 41aa678105..c70bfe84d1 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -72,7 +72,7 @@ check-local: ./run_unit.sh --log-file test.log --trs-file test.trs # FIXME 2: unit-oob.la fails with symbol undefined: # UnitWSD::testHandleRequest(UnitWSD::TestRequest, UnitHTTPServerRequest&, UnitHTTPServerResponse&) , -TESTS = unit-prefork.la unit-tilecache.la # unit-timeout.la # unit-storage.la unit-admin.la +TESTS = unit-prefork.la unit-tilecache.la unit-timeout.la # unit-storage.la unit-admin.la else TESTS = ${top_builddir}/test/test endif diff --git a/wsd/LOOLWSD.cpp b/wsd/LOOLWSD.cpp index e51bf921a1..db5f55a23a 100644 --- a/wsd/LOOLWSD.cpp +++ b/wsd/LOOLWSD.cpp @@ -2419,7 +2419,10 @@ int LOOLWSD::innerMain() UnitWSD::get().invokeTest(); // This timeout affects the recovery time of prespawned children. - mainWait.poll(SocketPoll::DefaultPollTimeoutMs * 4); + int msWait = UnitWSD::isUnitTesting() ? + UnitWSD::get().getTimeoutMilliSeconds() / 4 : + SocketPoll::DefaultPollTimeoutMs * 4; + mainWait.poll(msWait); // Wake the prisoner poll to spawn some children, if necessary. PrisonerPoll.wakeup(); |