Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
add_executable(ceph_test_neorados_start_stop start_stop.cc)
target_link_libraries(ceph_test_neorados_start_stop global libneorados ${unittest_libs})
+
+add_executable(ceph_test_neorados_completions completions.cc)
+target_link_libraries(ceph_test_neorados_completions Boost::system pthread
+ ${unittest_libs})
--- /dev/null
+#include <cassert>
+#include <boost/asio.hpp>
+#include <boost/system/system_error.hpp>
+
+constexpr int max_completions = 10'000'000;
+int completed = 0;
+
+boost::asio::io_context c;
+
+void nested_cb() {
+ if (++completed < max_completions)
+ c.post(&nested_cb);
+}
+
+int main(void) {
+ c.post(&nested_cb);
+ c.run();
+ assert(completed == max_completions);
+ return 0;
+}