================ @@ -223,6 +220,61 @@ TEST_F(MainLoopTest, ManyPendingCallbacks) { ASSERT_TRUE(loop.Run().Success()); } +TEST_F(MainLoopTest, CallbackWithTimeout) { + MainLoop loop; + 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)); ---------------- DavidSpickett wrote:
Or on Windows the definition of 2 seconds is a little more fuzzy than we'd like it to be :) https://github.com/llvm/llvm-project/pull/112895 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits