Skip to content

Commit

Permalink
porting Clickhouse #49755, Fix unit test ExceptionFromWait (#787)
Browse files Browse the repository at this point in the history
  • Loading branch information
lizhou1111 authored Jul 26, 2024
1 parent ccd37d6 commit 53ac6ae
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/Common/tests/gtest_thread_pool_schedule_exception.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,17 @@ static bool check2()
{
ThreadPool pool(2);

pool.scheduleOrThrowOnError([&]{ throw std::runtime_error("Hello, world!"); });
pool.scheduleOrThrowOnError([]{});
try
{
pool.scheduleOrThrowOnError([&]{ throw std::runtime_error("Hello, world!"); });
pool.scheduleOrThrowOnError([]{});
}
catch (const std::runtime_error &)
{
/// Sometimes exception may be thrown from schedule.
/// Just retry test in that case.
return true;
}

try
{
Expand Down

0 comments on commit 53ac6ae

Please sign in to comment.