[Libreoffice-commits] online.git: test/TileCacheTests.cpp

Ashod Nakashian (via logerrit) logerrit at kemper.freedesktop.org
Mon Oct 28 11:01:56 UTC 2019


 test/TileCacheTests.cpp |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 4ff376bb454ccb0c6d2106c978323305d0a2bb08
Author:     Ashod Nakashian <ashod.nakashian at collabora.co.uk>
AuthorDate: Wed Oct 16 09:09:59 2019 -0400
Commit:     Michael Meeks <michael.meeks at collabora.com>
CommitDate: Mon Oct 28 12:01:38 2019 +0100

    testTileWriteIDHandling: don't block for too long
    
    When polling for tile messages, the last wait
    (which will timeout) by default will be 10 seconds.
    This is too long to make the tests fast enough, and
    also results in the internal cache from evicting
    tiles in some cases.
    
    Reviewed-on: https://gerrit.libreoffice.org/80897
    Reviewed-by: Andras Timar <andras.timar at collabora.com>
    Tested-by: Andras Timar <andras.timar at collabora.com>
    (cherry picked from commit e173427bd9ca5939339994180f5b51ea11393050)
    
    Change-Id: I6c2b80022ffcef2b21c99dd57bca61e7daaadc86
    Reviewed-on: https://gerrit.libreoffice.org/81568
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
    Tested-by: Michael Meeks <michael.meeks at collabora.com>

diff --git a/test/TileCacheTests.cpp b/test/TileCacheTests.cpp
index 0eba9e2d3..ad0f46823 100644
--- a/test/TileCacheTests.cpp
+++ b/test/TileCacheTests.cpp
@@ -1145,7 +1145,7 @@ void TileCacheTests::requestTiles(std::shared_ptr<LOOLWebSocket>& socket, const
 
             sendTextFrame(socket, text, name);
             tile = assertResponseString(socket, "tile:", name);
-            // expected tile: nviewid=  part= width= height= tileposx= tileposy= tilewidth= tileheight=
+            // expected tile: nviewid= part= width= height= tileposx= tileposy= tilewidth= tileheight=
             Poco::StringTokenizer tokens(tile, " ", Poco::StringTokenizer::TOK_IGNORE_EMPTY | Poco::StringTokenizer::TOK_TRIM);
             CPPUNIT_ASSERT_EQUAL(std::string("tile:"), tokens[0]);
             CPPUNIT_ASSERT_EQUAL(0, std::stoi(tokens[1].substr(std::string("nviewid=").size())));
@@ -1243,7 +1243,8 @@ void TileCacheTests::testTileWireIDHandling()
     bool gotTile = false;
     do
     {
-        std::vector<char> tile = getResponseMessage(socket, "tile:", testname);
+        // If we wait for too long, the cached tiles will get evicted.
+        std::vector<char> tile = getResponseMessage(socket, "tile:", testname, 500);
         gotTile = !tile.empty();
         if(gotTile)
             ++arrivedTiles;
@@ -1393,7 +1394,7 @@ void TileCacheTests::testTileBeingRenderedHandling()
     bool gotTile = false;
     do
     {
-        std::vector<char> tile = getResponseMessage(socket, "tile:", testname);
+        std::vector<char> tile = getResponseMessage(socket, "tile:", testname, 500);
         gotTile = !tile.empty();
         if(gotTile)
             ++arrivedTiles;


More information about the Libreoffice-commits mailing list