diff options
author | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2019-10-16 09:09:59 -0400 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2019-10-28 12:01:38 +0100 |
commit | 4ff376bb454ccb0c6d2106c978323305d0a2bb08 (patch) | |
tree | 457d8675a780973a2e35e7813426e0ee6fc97b16 /test/TileCacheTests.cpp | |
parent | 9a3ab5541c977dcb266ce557de7c77feb25dada2 (diff) |
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@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
(cherry picked from commit e173427bd9ca5939339994180f5b51ea11393050)
Change-Id: I6c2b80022ffcef2b21c99dd57bca61e7daaadc86
Reviewed-on: https://gerrit.libreoffice.org/81568
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'test/TileCacheTests.cpp')
-rw-r--r-- | test/TileCacheTests.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
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; |