From 00078d8b434bb389fbc8c12d0b8fd5184ea81380 Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Thu, 4 Sep 2025 16:03:31 -0400 Subject: [PATCH] update test --- test/lwt/echo_client.ml | 18 ++++-- test/lwt/output_echo.expected | 105 ++++++++++++++++++++++++++++++++++ 2 files changed, 119 insertions(+), 4 deletions(-) diff --git a/test/lwt/echo_client.ml b/test/lwt/echo_client.ml index a25a9ba1..25a05b37 100644 --- a/test/lwt/echo_client.ml +++ b/test/lwt/echo_client.ml @@ -101,7 +101,17 @@ let () = in Arg.parse opts ignore "echo client"; - (* Lwt_engine.set @@ new Lwt_engine.libev (); *) - M_lwt.lwt_main @@ fun _runner -> - main ~port:!port ~n:!n ~n_conn:!n_conn ~verbose:!verbose - ~msg_per_conn:!msg_per_conn () + let main () = + (* Lwt_engine.set @@ new Lwt_engine.libev (); *) + M_lwt.lwt_main @@ fun _runner -> + main ~port:!port ~n:!n ~n_conn:!n_conn ~verbose:!verbose + ~msg_per_conn:!msg_per_conn () + in + + print_endline "first run"; + main (); + assert (not (M_lwt.is_setup ())); + print_endline "second run"; + main (); + assert (not (M_lwt.is_setup ())); + print_endline "done" diff --git a/test/lwt/output_echo.expected b/test/lwt/output_echo.expected index 5fdaef5d..a1b20abf 100644 --- a/test/lwt/output_echo.expected +++ b/test/lwt/output_echo.expected @@ -2,7 +2,21 @@ run echo server on port=12346 listening on port 12346 run echo client -p 12346 -n 10 --n-conn=2 -v all done +all done connecting to port 12346 (10 msg per conn, 10 conns total, 2 max at a time) +connecting to port 12346 (10 msg per conn, 10 conns total, 2 max at a time) +done +first run +read: hello 1 +read: hello 1 +read: hello 1 +read: hello 1 +read: hello 1 +read: hello 1 +read: hello 1 +read: hello 1 +read: hello 1 +read: hello 1 read: hello 1 read: hello 1 read: hello 1 @@ -23,6 +37,26 @@ read: hello 10 read: hello 10 read: hello 10 read: hello 10 +read: hello 10 +read: hello 10 +read: hello 10 +read: hello 10 +read: hello 10 +read: hello 10 +read: hello 10 +read: hello 10 +read: hello 10 +read: hello 10 +read: hello 2 +read: hello 2 +read: hello 2 +read: hello 2 +read: hello 2 +read: hello 2 +read: hello 2 +read: hello 2 +read: hello 2 +read: hello 2 read: hello 2 read: hello 2 read: hello 2 @@ -43,6 +77,26 @@ read: hello 3 read: hello 3 read: hello 3 read: hello 3 +read: hello 3 +read: hello 3 +read: hello 3 +read: hello 3 +read: hello 3 +read: hello 3 +read: hello 3 +read: hello 3 +read: hello 3 +read: hello 3 +read: hello 4 +read: hello 4 +read: hello 4 +read: hello 4 +read: hello 4 +read: hello 4 +read: hello 4 +read: hello 4 +read: hello 4 +read: hello 4 read: hello 4 read: hello 4 read: hello 4 @@ -63,6 +117,26 @@ read: hello 5 read: hello 5 read: hello 5 read: hello 5 +read: hello 5 +read: hello 5 +read: hello 5 +read: hello 5 +read: hello 5 +read: hello 5 +read: hello 5 +read: hello 5 +read: hello 5 +read: hello 5 +read: hello 6 +read: hello 6 +read: hello 6 +read: hello 6 +read: hello 6 +read: hello 6 +read: hello 6 +read: hello 6 +read: hello 6 +read: hello 6 read: hello 6 read: hello 6 read: hello 6 @@ -83,6 +157,26 @@ read: hello 7 read: hello 7 read: hello 7 read: hello 7 +read: hello 7 +read: hello 7 +read: hello 7 +read: hello 7 +read: hello 7 +read: hello 7 +read: hello 7 +read: hello 7 +read: hello 7 +read: hello 7 +read: hello 8 +read: hello 8 +read: hello 8 +read: hello 8 +read: hello 8 +read: hello 8 +read: hello 8 +read: hello 8 +read: hello 8 +read: hello 8 read: hello 8 read: hello 8 read: hello 8 @@ -103,3 +197,14 @@ read: hello 9 read: hello 9 read: hello 9 read: hello 9 +read: hello 9 +read: hello 9 +read: hello 9 +read: hello 9 +read: hello 9 +read: hello 9 +read: hello 9 +read: hello 9 +read: hello 9 +read: hello 9 +second run