make tests compile

This commit is contained in:
Simon Cruanes 2026-01-14 22:31:46 -05:00
parent 2a866e60f8
commit 4aee136827
No known key found for this signature in database
GPG key ID: EBFFF6F283F3A2B4
2 changed files with 11 additions and 12 deletions

View file

@ -7,7 +7,7 @@ let run () =
for _i = 1 to 50 do for _i = 1 to 50 do
Trace.with_span ~__FILE__ ~__LINE__ "outer.loop" @@ fun _sp -> Trace.with_span ~__FILE__ ~__LINE__ "outer.loop" @@ fun _sp ->
let pseudo_async_sp = let pseudo_async_sp =
Trace.enter_manual_span ~parent:None ~__FILE__ ~__LINE__ "fake_sleep" Trace.enter_span ~parent:None ~__FILE__ ~__LINE__ "fake_sleep"
in in
for _j = 2 to 5 do for _j = 2 to 5 do
@ -22,8 +22,7 @@ let run () =
if _j = 2 then ( if _j = 2 then (
Trace.add_data_to_span _sp [ "j", `Int _j ]; Trace.add_data_to_span _sp [ "j", `Int _j ];
let _sp = let _sp =
Trace.enter_manual_span Trace.enter_span ~parent:(Some pseudo_async_sp)
~parent:(Some (Trace.ctx_of_span pseudo_async_sp))
~flavor: ~flavor:
(if _i mod 3 = 0 then (if _i mod 3 = 0 then
`Sync `Sync
@ -34,11 +33,11 @@ let run () =
(* fake micro sleep *) (* fake micro sleep *)
Thread.delay 0.005; Thread.delay 0.005;
Trace.exit_manual_span _sp Trace.exit_span _sp
) else if _j = 3 then ( ) else if _j = 3 then (
(* pretend some task finished. Note that this is not well scoped wrt other spans. *) (* pretend some task finished. Note that this is not well scoped wrt other spans. *)
Trace.add_data_to_manual_span pseudo_async_sp [ "slept", `Bool true ]; Trace.add_data_to_span pseudo_async_sp [ "slept", `Bool true ];
Trace.exit_manual_span pseudo_async_sp Trace.exit_span pseudo_async_sp
) )
done done
done done

View file

@ -7,7 +7,8 @@ let run () =
for _i = 1 to 50 do for _i = 1 to 50 do
Trace.with_span ~__FILE__ ~__LINE__ "outer.loop" @@ fun _sp -> Trace.with_span ~__FILE__ ~__LINE__ "outer.loop" @@ fun _sp ->
let pseudo_async_sp = let pseudo_async_sp =
Trace.enter_manual_span ~parent:None ~__FILE__ ~__LINE__ "fake_sleep" Trace.enter_span ~parent:None ~flavor:`Async ~__FILE__ ~__LINE__
"fake_sleep"
in in
for _j = 2 to 5 do for _j = 2 to 5 do
@ -22,8 +23,7 @@ let run () =
if _j = 2 then ( if _j = 2 then (
Trace.add_data_to_span _sp [ "j", `Int _j ]; Trace.add_data_to_span _sp [ "j", `Int _j ];
let _sp = let _sp =
Trace.enter_manual_span Trace.enter_span ~parent:(Some pseudo_async_sp)
~parent:(Some (Trace.ctx_of_span pseudo_async_sp))
~flavor: ~flavor:
(if _i mod 3 = 0 then (if _i mod 3 = 0 then
`Sync `Sync
@ -34,11 +34,11 @@ let run () =
(* fake micro sleep *) (* fake micro sleep *)
Thread.delay 0.005; Thread.delay 0.005;
Trace.exit_manual_span _sp Trace.exit_span _sp
) else if _j = 3 then ( ) else if _j = 3 then (
(* pretend some task finished. Note that this is not well scoped wrt other spans. *) (* pretend some task finished. Note that this is not well scoped wrt other spans. *)
Trace.add_data_to_manual_span pseudo_async_sp [ "slept", `Bool true ]; Trace.add_data_to_span pseudo_async_sp [ "slept", `Bool true ];
Trace.exit_manual_span pseudo_async_sp Trace.exit_span pseudo_async_sp
) )
done done
done done