Skip to content

Commit

Permalink
fix runtime-events tests to be more robust to GC variations
Browse files Browse the repository at this point in the history
  • Loading branch information
damiendoligez committed Oct 20, 2023
1 parent a7cd0c6 commit 7ae91bc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions testsuite/tests/lib-runtime-events/test.ml
Expand Up @@ -7,6 +7,7 @@ external start_runtime_events : unit -> unit = "start_runtime_events"
external get_event_counts : unit -> (int * int) = "get_event_counts"

let () =
Gc.full_major ();
start_runtime_events ();
for a = 0 to 2 do
ignore(Sys.opaque_identity(ref 42));
Expand All @@ -21,4 +22,5 @@ let () =
Gc.compact ();
Runtime_events.pause ()
done;
let (minors, majors) = get_event_counts () in
Printf.printf "minors: %d, majors: %d\n" minors majors
2 changes: 1 addition & 1 deletion testsuite/tests/lib-runtime-events/test.reference
@@ -1,2 +1,2 @@
minors: 9, majors: 0
minors: 9, majors: 0
minors: 18, majors: 0
1 change: 1 addition & 0 deletions testsuite/tests/lib-runtime-events/test_caml.ml
Expand Up @@ -78,6 +78,7 @@ let majors_per_epoch = 50
let conses_per_major = 10

let () =
Gc.full_major ();
let list_ref = ref [] in
start ();
let cursor = create_cursor None in
Expand Down

0 comments on commit 7ae91bc

Please sign in to comment.