Skip to content

Commit

Permalink
make tests/lib-runtime-events/test_instrumented.ml more stable wrt GC…
Browse files Browse the repository at this point in the history
… behavior
  • Loading branch information
damiendoligez committed Jun 27, 2023
1 parent ce7fbd7 commit ee5ee5d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions testsuite/tests/lib-runtime-events/test_instrumented.ml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,16 @@ let lost_events domain_id words =
let () =
Gc.full_major ();
start ();
let minors_at_start = (Gc.quick_stat ()).Gc.minor_collections in
let cursor = create_cursor None in
for a = 0 to 1_000_000 do
list_ref := (Sys.opaque_identity(ref 42)) :: !list_ref
done;
Gc.full_major ();
let callbacks = Callbacks.create ~runtime_end ~alloc ~lost_events () in
ignore(read_poll cursor callbacks None);
Printf.printf "lost_event_words: %d, total_sizes: %d, total_minors: %d\n"
!lost_event_words !total_sizes !total_minors
let self_minors =
(Gc.quick_stat ()).Gc.minor_collections - minors_at_start
in
Printf.printf "lost_event_words: %d, total_sizes: %d, diff_minors: %d\n"
!lost_event_words !total_sizes (!total_minors - self_minors)
Original file line number Diff line number Diff line change
@@ -1 +1 @@
lost_event_words: 0, total_sizes: 2000004, total_minors: 31
lost_event_words: 0, total_sizes: 2000004, diff_minors: 0

0 comments on commit ee5ee5d

Please sign in to comment.