From 4ff376bb454ccb0c6d2106c978323305d0a2bb08 Mon Sep 17 00:00:00 2001 From: Ashod Nakashian Date: Wed, 16 Oct 2019 09:09:59 -0400 Subject: 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 Tested-by: Andras Timar (cherry picked from commit e173427bd9ca5939339994180f5b51ea11393050) Change-Id: I6c2b80022ffcef2b21c99dd57bca61e7daaadc86 Reviewed-on: https://gerrit.libreoffice.org/81568 Reviewed-by: Michael Meeks Tested-by: Michael Meeks --- test/TileCacheTests.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'test/TileCacheTests.cpp') 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& 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 tile = getResponseMessage(socket, "tile:", testname); + // If we wait for too long, the cached tiles will get evicted. + std::vector 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 tile = getResponseMessage(socket, "tile:", testname); + std::vector tile = getResponseMessage(socket, "tile:", testname, 500); gotTile = !tile.empty(); if(gotTile) ++arrivedTiles; -- cgit v1.2.3