From c83cea832475143bbc4ecbf0916b4545d57334f5 Mon Sep 17 00:00:00 2001 From: mwilsnd Date: Wed, 28 Aug 2024 19:38:21 -0500 Subject: [PATCH] Update test case --- test/map/map.test.cpp | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/test/map/map.test.cpp b/test/map/map.test.cpp index adaef7d9555..0ef2db1ef25 100644 --- a/test/map/map.test.cpp +++ b/test/map/map.test.cpp @@ -1818,10 +1818,23 @@ TEST(Map, ObserveTileLifecycle) { break; } case TileOperation::EndParse: { - // The tile loader will try the cache first. If a cache hit is found, it starts parsing it while - // loading from the network. In the event data the cache is invalid, the network request will return - // newer data and update the geometry tile worker, which was already parsing the cached data. - EXPECT_THAT(stage, testing::AnyOf(TileOperation::StartParse, TileOperation::LoadFromNetwork)); + // The following are both possible: + // * RequestedFromCache -> LoadFromCache -> StartParse -> RequestedFromNetwork -> EndParse -> + // LoadFromNetwork -> StartParse -> EndParse + // The parsing stage is initiated by the cached version. The network request doesn't arrive + // until after the cached version has completed parsing. A new parsing task is spawned, resulting + // in a pair of Start and EndParse events. + // + // * RequestedFromCache -> LoadFromCache -> StartParse -> + // RequestedFromNetwork -> LoadFromNetwork -> EndParse + // The parsing stage is initiated by the cached version before being interrupted + // by data from a new version downloaded over the network. This interruption doesn't cancel the + // ongoing parsing task, so ::EndParse will end up being emitted only once by completion of the + // newer tile's data. + EXPECT_THAT(stage, + testing::AnyOf(TileOperation::StartParse, + TileOperation::LoadFromNetwork, + TileOperation::RequestedFromNetwork)); stage = TileOperation::EndParse; break; }