fix: ASAN issues from runSpawnWithTimeout (#2482)

This commit is contained in:
Alex Kremer
2025-08-28 11:47:23 +01:00
committed by GitHub
parent 33c0737933
commit ae15bbd7b5
3 changed files with 5 additions and 36 deletions

View File

@@ -157,7 +157,7 @@ TEST_P(BlockingCacheWaitTest, WaitForUpdate)
if (GetParam().updateSuccessful)
EXPECT_CALL(mockVerifier, Call(value)).WillOnce(Return(GetParam().verifierAccepts));
runSpawnWithTimeout(std::chrono::seconds{1}, [&](boost::asio::yield_context yield) {
runSpawn([&](boost::asio::yield_context yield) {
auto result = cache->asyncGet(yield, mockUpdater.AsStdFunction(), mockVerifier.AsStdFunction());
if (GetParam().updateSuccessful) {
@@ -244,7 +244,5 @@ TEST_F(BlockingCacheTest, UpdateFromTwoCoroutinesHappensOnlyOnce)
ASSERT_EQ(result.value(), value);
};
runSpawnWithTimeout(std::chrono::seconds{1}, [&](boost::asio::yield_context yield) {
util::spawn(yield, updatingCoroutine);
});
runSpawn([&](boost::asio::yield_context yield) { util::spawn(yield, updatingCoroutine); });
}

View File

@@ -397,7 +397,7 @@ TEST_F(WebWsConnectionTests, CloseCalledFromMultipleSubCoroutines)
testing::StrictMock<testing::MockFunction<void()>> closeCalled;
EXPECT_CALL(closeCalled, Call).Times(2);
runSpawnWithTimeout(std::chrono::seconds{1}, [&](boost::asio::yield_context yield) {
runSpawn([&](boost::asio::yield_context yield) {
auto wsConnection = acceptConnection(yield);
util::CoroutineGroup coroutines{yield};
for ([[maybe_unused]] int const i : std::ranges::iota_view{0, 2}) {