fix tests

This commit is contained in:
Simon Cruanes 2025-09-05 12:55:05 -04:00
parent 86b64ae3d4
commit 44edf60836
No known key found for this signature in database
GPG key ID: EBFFF6F283F3A2B4
3 changed files with 15 additions and 17 deletions

View file

@ -1,9 +1,6 @@
open! Moonpool
let ( let@ ) = ( @@ ) let ( let@ ) = ( @@ )
let runner = Fifo_pool.create ~num_threads:1 ()
let () = let () =
let@ runner = Moonpool_fib.main in
T_fibers.Fib.run1 ~runner (); T_fibers.Fib.run1 ~runner ();
T_fibers.Fib.run2 ~runner (); T_fibers.Fib.run2 ~runner ()

View file

@ -19,15 +19,17 @@ let () =
assert (r = 13) assert (r = 13)
let () = let () =
Printf.eprintf "PART 2\n%!"; (* run multiple times to make sure cleanup is correct *)
try for _i = 1 to 10 do
let _r = try
M_lwt.lwt_main @@ fun runner -> let _r =
let fib = F.spawn_top ~on:runner (fun () -> failwith "oops") in M_lwt.lwt_main @@ fun runner ->
F.await fib let fib = F.spawn_top ~on:runner (fun () -> failwith "oops") in
in F.await fib
in
assert false assert false
with Failure msg -> with Failure msg ->
(* Printf.eprintf "got %S\n%!" msg; *) (* Printf.eprintf "got %S\n%!" msg; *)
assert (msg = "oops") assert (msg = "oops")
done

View file

@ -1,4 +1,3 @@
module M = Moonpool
module M_lwt = Moonpool_lwt module M_lwt = Moonpool_lwt
module Trace = Trace_core module Trace = Trace_core