mirror of
https://github.com/c-cube/moonpool.git
synced 2025-12-06 03:05:30 -05:00
fix CI for lwt tests
This commit is contained in:
parent
da551edbd3
commit
50b9dd9b62
3 changed files with 11 additions and 7 deletions
|
|
@ -36,9 +36,12 @@
|
||||||
(= %{system} "linux")
|
(= %{system} "linux")
|
||||||
(>= %{ocaml_version} 5.0)))
|
(>= %{ocaml_version} 5.0)))
|
||||||
(action
|
(action
|
||||||
|
(setenv
|
||||||
|
CI_MODE
|
||||||
|
1
|
||||||
(with-stdout-to
|
(with-stdout-to
|
||||||
%{targets}
|
%{targets}
|
||||||
(run ./run_echo.sh -n 10 --n-conn=2 -v))))
|
(run ./run_echo.sh -n 10 --n-conn=2 -v)))))
|
||||||
|
|
||||||
(rule
|
(rule
|
||||||
(alias runtest)
|
(alias runtest)
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
module M_lwt = Moonpool_lwt
|
module M_lwt = Moonpool_lwt
|
||||||
module Trace = Trace_core
|
module Trace = Trace_core
|
||||||
|
|
||||||
|
let ci_mode = Option.is_some @@ Sys.getenv_opt "CI_MODE"
|
||||||
let spf = Printf.sprintf
|
let spf = Printf.sprintf
|
||||||
let await_lwt = Moonpool_lwt.await_lwt
|
let await_lwt = Moonpool_lwt.await_lwt
|
||||||
let ( let@ ) = ( @@ )
|
let ( let@ ) = ( @@ )
|
||||||
|
|
@ -68,6 +69,7 @@ let main ~port ~n ~n_conn ~verbose ~msg_per_conn () : unit =
|
||||||
|
|
||||||
Printf.printf "all done\n%!";
|
Printf.printf "all done\n%!";
|
||||||
let elapsed = Unix.gettimeofday () -. t0 in
|
let elapsed = Unix.gettimeofday () -. t0 in
|
||||||
|
if not ci_mode then
|
||||||
Printf.printf " sent %d messages in %.4fs (%.2f msg/s)\n%!" !n_msg_total
|
Printf.printf " sent %d messages in %.4fs (%.2f msg/s)\n%!" !n_msg_total
|
||||||
elapsed
|
elapsed
|
||||||
(float !n_msg_total /. elapsed);
|
(float !n_msg_total /. elapsed);
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
run echo server on port=12346
|
run echo server on port=12346
|
||||||
listening on port 12346
|
listening on port 12346
|
||||||
run echo client -p 12346 -n 10 --n-conn=2 -v
|
run echo client -p 12346 -n 10 --n-conn=2 -v
|
||||||
sent 100 messages in 0.0175s (5720.16 msg/s)
|
|
||||||
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)
|
||||||
read: hello 1
|
read: hello 1
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue