diff --git a/test/v1/exit_code.cpp b/test/v1/exit_code.cpp index 2eb8d8dc5..8335033d0 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