[Libreoffice-commits] online.git: test/helpers.hpp

Miklos Vajna (via logerrit) logerrit at kemper.freedesktop.org
Mon Feb 17 09:09:23 UTC 2020


 test/helpers.hpp |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 8c9e539586e863adef7ca811eeec086289435ea0
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Mon Feb 17 09:08:34 2020 +0100
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Mon Feb 17 10:09:05 2020 +0100

    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 at gmail.com>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>

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)


More information about the Libreoffice-commits mailing list