diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2020-02-17 09:08:34 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2020-02-17 10:09:05 +0100 |
commit | 8c9e539586e863adef7ca811eeec086289435ea0 (patch) | |
tree | f95287eb63cca19c30a1efcd0a8ddcccd56eec91 /test/helpers.hpp | |
parent | 40f9341d4416838ada58eff9f2579d8f29a7ef5b (diff) |
test: improve timeout handling in getResponseMessage()
Sometimes unit-each-view fails on me in a situation like this:
21:00:13.331257 [ loolwsd ] TRC debug, testEachView: waiting for message, timeout after 20s| UnitEachView.cpp:66
21:00:20.429615 [ loolwsd ] TRC debug, testEachView: response is empty, will fail| UnitEachView.cpp:72
I.e. for some reason ws.poll() returns after 7 seconds, even if the
timeout at test/UnitEachView.cpp is clearly 20 seconds.
Fix the problem by trying again in case we got no data -- we'll still
break from the loop on timeout.
Change-Id: I913ecd692f350b9deb38705a0a2d24e8b3c799a0
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88846
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'test/helpers.hpp')
-rw-r--r-- | test/helpers.hpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/test/helpers.hpp b/test/helpers.hpp index 9aa15d518..1a0205475 100644 --- a/test/helpers.hpp +++ b/test/helpers.hpp @@ -289,7 +289,8 @@ std::vector<char> getResponseMessage(LOOLWebSocket& ws, const std::string& prefi if (bytes <= 0) { - break; + // Try again, timeout will be handled above. + continue; } if ((flags & Poco::Net::WebSocket::FRAME_OP_BITMASK) != Poco::Net::WebSocket::FRAME_OP_CLOSE) |