diff --git a/lldb/unittests/Host/MainLoopTest.cpp b/lldb/unittests/Host/MainLoopTest.cpp index 448ad9cfd20f0..0cbc69935aa9c 100644 --- a/lldb/unittests/Host/MainLoopTest.cpp +++ b/lldb/unittests/Host/MainLoopTest.cpp @@ -421,9 +421,9 @@ TEST_F(MainLoopTest, ManyPendingCallbacks) { TEST_F(MainLoopTest, CallbackWithTimeout) { MainLoop loop; + auto start = std::chrono::steady_clock::now(); loop.AddCallback([](MainLoopBase &loop) { loop.RequestTermination(); }, std::chrono::seconds(2)); - auto start = std::chrono::steady_clock::now(); ASSERT_THAT_ERROR(loop.Run().takeError(), llvm::Succeeded()); EXPECT_GE(std::chrono::steady_clock::now() - start, std::chrono::seconds(2)); }