From fa83c2f9ffcd3bbdfa9244c777b64e3ca98c07c4 Mon Sep 17 00:00:00 2001 From: Klemens Morgenstern Date: Fri, 8 Nov 2024 20:29:11 +0800 Subject: [PATCH] fixes the exit-code error on osx builds. --- test/v1/exit_code.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/test/v1/exit_code.cpp b/test/v1/exit_code.cpp index 2eb8d8dc..8335033d 100644 --- a/test/v1/exit_code.cpp +++ b/test/v1/exit_code.cpp @@ -148,12 +148,17 @@ BOOST_AUTO_TEST_CASE(async_nowait, *boost::unit_test::timeout(10)) boost::asio::io_context io_context; bp::child c( master_test_suite().argv[1], - "test", "--exit-code", "221", + "test", "--exit-code", "121", ec, bp::on_exit=[](int exit_code, std::error_code) mutable {}, io_context ); BOOST_REQUIRE(!ec); - io_context.run_for(std::chrono::milliseconds(100)); - BOOST_CHECK_EQUAL(221, c.exit_code()); + while (c.running()) + { + io_context.run_for(std::chrono::milliseconds(10)); + io_context.restart(); + } + + BOOST_CHECK_EQUAL(121, c.exit_code()); } \ No newline at end of file