Address some flaky tests (#2837)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
@@ -1808,7 +1808,10 @@ TEST(Map, ObserveTileLifecycle) {
|
||||
case TileOperation::StartParse: {
|
||||
// Parsing is expected to be started early during the request process by a call to `setLayers`
|
||||
EXPECT_THAT(stage,
|
||||
testing::AnyOf(TileOperation::RequestedFromCache, TileOperation::RequestedFromNetwork));
|
||||
testing::AnyOf(TileOperation::RequestedFromCache,
|
||||
TileOperation::RequestedFromNetwork,
|
||||
TileOperation::LoadFromCache,
|
||||
TileOperation::LoadFromNetwork));
|
||||
EXPECT_FALSE(parsing); // We must not already be parsing when seeing this marker.
|
||||
stage = TileOperation::StartParse;
|
||||
parsing = true;
|
||||
|
||||
@@ -82,6 +82,7 @@ TEST(RunLoop, PlatformIntegration) {
|
||||
loop.setPlatformCallback([&] {
|
||||
EXPECT_NE(mainThread, std::this_thread::get_id());
|
||||
count1++;
|
||||
std::unique_lock<std::mutex> lock(mutex);
|
||||
cv.notify_one();
|
||||
});
|
||||
|
||||
@@ -100,6 +101,7 @@ TEST(RunLoop, PlatformIntegration) {
|
||||
while (count2 < 200000) {
|
||||
std::unique_lock<std::mutex> lock(mutex);
|
||||
cv.wait(lock);
|
||||
lock.unlock();
|
||||
loop.runOnce();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user