Skip to content

Commit

Permalink
Add Random.self_init to stress test domains
Browse files Browse the repository at this point in the history
  • Loading branch information
polytypic committed Dec 24, 2023
1 parent 529e3e2 commit aa10637
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/Multicore_magic_test.ml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ let test_instantaneous_domain_index () =
in

let domain () =
Random.self_init ();

Atomic.incr num_started;
(* [Domain.DLS] is not thread-safe so it might be necessary to make sure
we get the index before spawning threads: *)
Expand All @@ -136,6 +138,8 @@ let test_instantaneous_domain_index () =
Atomic.incr num_exited
in

Random.self_init ();

let threads =
Array.init n_domains @@ fun _ ->
()
Expand Down

0 comments on commit aa10637

Please sign in to comment.