fix test for FLS

use the inheritable keys
This commit is contained in:
Simon Cruanes 2024-08-30 12:51:38 -04:00
parent c03949dbd9
commit 0da3ce4e72
No known key found for this signature in database
GPG key ID: EBFFF6F283F3A2B4
2 changed files with 6 additions and 3 deletions

View file

@ -9,6 +9,9 @@ clean:
test:
@dune runtest $(DUNE_OPTS)
test-autopromote:
@dune runtest $(DUNE_OPTS) --auto-promote
doc:
@dune build $(DUNE_OPTS) @doc

View file

@ -7,7 +7,7 @@ module FLS = Moonpool_fib.Fls
type span_id = int
let k_parent : span_id option FLS.t = FLS.create ()
let k_parent : span_id Hmap.key = Hmap.Key.create ()
let ( let@ ) = ( @@ )
let spf = Printf.sprintf
@ -39,10 +39,10 @@ module Tracer = struct
let with_span self name f =
let id = Span.new_id_ () in
let parent = FLS.get ~default:None k_parent in
let parent = FLS.get_in_local_hmap_opt k_parent in
let span = { Span.id; parent; msg = name } in
add self span;
FLS.with_value k_parent (Some id) f
FLS.with_in_local_hmap k_parent id f
end
module Render = struct