Skip to content

Commit b8bbdfd

Browse files
committed
Re-enable parallel tests
Includes several systhreads tests that rely on the interaction between systhreads, domains and backup threads. (cherry picked from commit c31eebd)
1 parent 98df6c4 commit b8bbdfd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+118
-129
lines changed

ocaml/otherlibs/str/str.ml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -607,16 +607,6 @@ external re_search_forward: regexp -> string -> int -> int array
607607
external re_search_backward: regexp -> string -> int -> int array
608608
= "re_search_backward"
609609

610-
module Domain = struct
611-
module DLS = struct
612-
613-
(* CR ocaml 5 domains: Remove this proxy and use the real Domain.DLS *)
614-
let[@inline always] new_key f = ref (f ())
615-
let[@inline always] set k s = k := s
616-
let[@inline always] get k = !k
617-
end
618-
end
619-
620610
let last_search_result_key = Domain.DLS.new_key (fun () -> [||])
621611

622612
let string_match re s pos =

ocaml/testsuite/tests/gc-roots/globroots_parallel.ml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
(* TEST
22
flags += " -w a ";
33
modules = "globrootsprim.c globroots.ml";
4-
reason = "CR ocaml 5 domains: re-enable this test";
5-
skip;
4+
runtime5;
5+
{ bytecode; }
6+
{ native; }
67
*)
78

89
open Globroots

ocaml/testsuite/tests/gc-roots/globroots_parallel_spawn_burn.ml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
(* TEST
22
flags += " -w a ";
33
modules = "globrootsprim.c globroots.ml";
4-
reason = "CR ocaml 5 domains: re-enable this test";
5-
skip;
4+
runtime5;
5+
{ bytecode; }
6+
{ native; }
67
*)
78

89
open Globroots

ocaml/testsuite/tests/lazy/lazy2.ml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
(* TEST
22
ocamlopt_flags += " -O3 ";
3-
reason = "CR ocaml 5 domains: re-enable this test";
4-
skip;
3+
runtime5;
4+
{ bytecode; }
5+
{ native; }
56
*)
67

78
open Domain

ocaml/testsuite/tests/lazy/lazy3.ml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
(* TEST
22
ocamlopt_flags += " -O3 ";
3-
reason = "CR ocaml 5 domains: re-enable this test";
4-
skip;
3+
runtime5;
4+
{ bytecode; }
5+
{ native; }
56
*)
67

78
let f count =

ocaml/testsuite/tests/lazy/lazy5.ml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
(* TEST
22
ocamlopt_flags += " -O3 ";
3-
reason = "CR ocaml 5 domains: re-enable this test";
4-
skip;
3+
runtime5;
4+
{ bytecode; }
5+
{ native; }
56
*)
67
let rec safe_force l =
78
try Lazy.force l with

ocaml/testsuite/tests/lazy/lazy6.ml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
(* TEST
22
ocamlopt_flags += " -O3 ";
3-
reason = "CR ocaml 5 domains: re-enable this test";
4-
skip;
3+
runtime5;
4+
{ bytecode; }
5+
{ native; }
56
*)
67

78
let flag1 = Atomic.make false

ocaml/testsuite/tests/lazy/lazy7.ml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
(* TEST
22
ocamlopt_flags += " -O3 ";
3-
reason = "CR ocaml 5 domains: re-enable this test";
4-
skip;
3+
runtime5;
4+
{ bytecode; }
5+
{ native; }
56
*)
67

78
let num_domains = 4

ocaml/testsuite/tests/lazy/lazy8.ml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
(* TEST
22
ocamlopt_flags += " -O3 ";
3-
reason = "CR ocaml 5 domains: re-enable this test";
4-
skip;
3+
runtime5;
4+
{ bytecode; }
5+
{ native; }
56
*)
67

78
exception E

ocaml/testsuite/tests/lf_skiplist/test_parallel.ml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
(* TEST
22
modules = "stubs.c";
3-
no-tsan; (* Takes too much time and memory with tsan *)
4-
reason = "CR ocaml 5 domains: re-enable this test";
5-
skip;
3+
no-tsan;
4+
runtime5;
5+
{ bytecode; }
6+
{ native; }
67
*)
78

89
external init_skiplist : unit -> unit = "init_skiplist"

ocaml/testsuite/tests/lib-channels/refcounting.ml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
(* TEST
2-
reason = "CR ocaml 5 domains: re-enable this test";
3-
skip;
2+
runtime5;
43
expect;
54
*)
65

ocaml/testsuite/tests/lib-dynlink-domains/main.ml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
(* TEST
2-
reason = "CR ocaml 5 domains: re-enable this test";
3-
skip;
4-
*)
5-
6-
(* BACKPORT
7-
(* TEST
2+
runtime5;
83
include dynlink;
94
libraries = "";
105
readonly_files = "store.ml main.ml Plugin_0.ml Plugin_0_0.ml Plugin_0_0_0.ml Plugin_0_0_0_0.ml Plugin_0_0_0_1.ml Plugin_0_0_0_2.ml Plugin_1.ml Plugin_1_0.ml Plugin_1_0_0.ml Plugin_1_0_0_0.ml Plugin_1_1.ml Plugin_1_2.ml Plugin_1_2_0.ml Plugin_1_2_0_0.ml Plugin_1_2_1.ml Plugin_1_2_2.ml Plugin_1_2_2_0.ml Plugin_1_2_3.ml Plugin_1_2_3_0.ml";
@@ -228,5 +223,3 @@ let stored = Atomic.get Store.store
228223
let stored_set = String_set.of_list stored
229224
let () =
230225
List.iter (Printf.printf "%s\n") (String_set.elements stored_set)
231-
232-
*)

ocaml/testsuite/tests/lib-format/domains.ml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
(* TEST
2-
reason = "CR ocaml 5 domains: re-enable this test";
3-
skip;
2+
runtime5;
3+
{ bytecode; }
4+
{ native; }
45
*)
56

67
(** Test that domains stdout and stderr are flushed at domain exit *)

ocaml/testsuite/tests/lib-format/mc_pr586_par.ml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
(* TEST
2-
reason = "CR ocaml 5 domains: re-enable this test";
3-
skip;
2+
runtime5;
3+
{ bytecode; }
4+
{ native; }
45
*)
56

67
let () =

ocaml/testsuite/tests/lib-format/mc_pr586_par2.ml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
(* TEST
2-
reason = "CR ocaml 5 domains: re-enable this test";
3-
skip;
2+
runtime5;
3+
{ bytecode; }
4+
{ native; }
45
*)
56

67
let () =

ocaml/testsuite/tests/lib-marshal/intext_par.ml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
(* TEST
2-
reason = "CR ocaml 5 domains: re-enable this test";
32
modules = "intextaux_par.c";
4-
no-tsan; (* Takes too much time and memory with tsan *)
5-
skip;
3+
no-tsan;
4+
runtime5;
5+
{ bytecode; }
6+
{ native; }
67
*)
78

89
(* Test for output_value / input_value *)

ocaml/testsuite/tests/lib-random/parallel.ml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
(* TEST
22
include unix;
3-
reason = "CR ocaml 5 domains: re-enable this test";
4-
skip;
3+
runtime5;
54
libunix;
65
{
76
bytecode;

ocaml/testsuite/tests/lib-str/parallel.ml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
(* TEST
2-
reason = "CR ocaml 5 domains: re-enable this test";
3-
skip;
2+
runtime5;
43
include str;
54
hasstr;
65
{

ocaml/testsuite/tests/lib-sync/prodcons.ml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
(* TEST
2-
reason = "CR ocaml 5 domains: re-enable this test";
3-
skip;
2+
runtime5;
3+
{ bytecode; }
4+
{ native; }
45
*)
56

67
(* Classic producer-consumer *)

ocaml/testsuite/tests/lib-systhreads/multicore_lifecycle.ml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
(* TEST
2-
reason = "CR ocaml 5 domains: re-enable this test";
3-
skip;
42
include systhreads;
53
hassysthreads;
4+
runtime5;
65
{
76
bytecode;
87
}{

ocaml/testsuite/tests/lib-unix/common/multicore_fork_domain_alone.ml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
(* TEST
2+
runtime5;
23
include unix;
3-
reason = "CR ocaml 5 domains: re-enable this test";
4-
skip;
54
hasunix;
65
not-windows;
76
{

ocaml/testsuite/tests/lib-unix/common/multicore_fork_domain_alone2.ml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
(* TEST
2+
runtime5;
23
include unix;
3-
reason = "CR ocaml 5 domains: re-enable this test";
4-
skip;
54
hasunix;
65
not-windows;
76
{

ocaml/testsuite/tests/memory-model/forbidden.ml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
(* TEST
22
modules = "opt.ml barrier.ml hist.ml shared.ml run.ml outcome.ml";
3-
reason = "CR ocaml 5 domains: re-enable this test";
4-
skip;
53
not-bsd;
64
no-tsan; (* tsan detects the intentional data races and fails *)
5+
runtime5;
76
{
87
bytecode;
98
}{

ocaml/testsuite/tests/memory-model/publish.ml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
(* TEST
22
modules = "opt.ml barrier.ml hist.ml shared.ml run.ml outcome.ml";
3-
reason = "CR ocaml 5 domains: re-enable this test";
4-
skip;
53
not-bsd;
64
no-tsan; (* tsan detects data races and fails *)
5+
runtime5;
76
{
87
not-windows;
98
bytecode;

ocaml/testsuite/tests/parallel/atomics.ml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
(* TEST
2-
reason = "CR ocaml 5 domains: re-enable this test";
3-
skip;
2+
runtime5;
3+
{ bytecode; }
4+
{ native; }
45
*)
56

67
type u = U of unit

ocaml/testsuite/tests/parallel/backup_thread.ml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
(* TEST
2-
reason = "CR ocaml 5 domains: re-enable this test";
3-
skip;
2+
runtime5;
43
include unix;
54
hasunix;
65
{

ocaml/testsuite/tests/parallel/backup_thread_pipe.ml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
(* TEST
2-
reason = "CR ocaml 5 domains: re-enable this test";
3-
skip;
2+
runtime5;
43
include unix;
54
hasunix;
65
{

ocaml/testsuite/tests/parallel/catch_break.ml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
(* TEST
2-
reason = "CR ocaml 5 domains: re-enable this test";
3-
skip;
4-
*)
5-
6-
(*
72
hassysthreads;
83
include systhreads;
94
not-windows;
5+
poll-insertion;
106
no-tsan;
117
{
128
bytecode;
@@ -79,7 +75,7 @@ let rec wait n =
7975
callback implementation than we want.*)
8076
let break_trap s =
8177
begin
82-
try Atomic.incr ready_count; while true do () done
78+
try Sys.with_async_exns (fun () -> Atomic.incr ready_count; while true do () done)
8379
with Sys.Break -> print "[Sys.Break caught]"
8480
end;
8581
print s;
@@ -112,7 +108,7 @@ let run () =
112108

113109
let () =
114110
Sys.catch_break true;
115-
(try run () with Sys.Break ->
111+
(try Sys.with_async_exns run with Sys.Break ->
116112
print ("Test could not complete due to scheduling hazard"
117113
^ " (possible false positive)."));
118114
print "Success.";

ocaml/testsuite/tests/parallel/constpromote.ml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
(* TEST
2-
reason = "CR ocaml 5 domains: re-enable this test";
3-
skip;
2+
runtime5;
3+
{ bytecode; }
4+
{ native; }
45
*)
56

67
(* when run with the bytecode debug runtime, this test

ocaml/testsuite/tests/parallel/deadcont.ml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
(* TEST
2-
reason = "CR ocaml 5 effects: re-enable this test";
32
skip;
3+
runtime5;
4+
{ bytecode; }
5+
{ native; }
46
*)
57

68
(*

ocaml/testsuite/tests/parallel/domain_dls.ml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
(* TEST
2-
reason = "CR ocaml 5 domains: re-enable this test";
3-
skip;
2+
runtime5;
3+
{ bytecode; }
4+
{ native; }
45
*)
56

67
let check_dls () =

ocaml/testsuite/tests/parallel/domain_dls2.ml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
(* TEST
2-
reason = "CR ocaml 5 domains: re-enable this test";
3-
skip;
2+
runtime5;
3+
{ bytecode; }
4+
{ native; }
45
*)
56

67
let _ =

ocaml/testsuite/tests/parallel/domain_id.ml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
(* TEST
2-
reason = "CR ocaml 5 domains: re-enable this test";
3-
skip;
2+
runtime5;
3+
{ bytecode; }
4+
{ native; }
45
*)
56

67
open Domain

ocaml/testsuite/tests/parallel/domain_parallel_spawn_burn.ml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
(* TEST
2-
reason = "CR ocaml 5 domains: re-enable this test";
3-
skip;
2+
runtime5;
3+
{ bytecode; }
4+
{ native; }
45
*)
56

67
open Domain

ocaml/testsuite/tests/parallel/domain_parallel_spawn_burn_gc_set.ml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
(* TEST
2-
reason = "CR ocaml 5 domains: re-enable this test";
3-
skip;
2+
runtime5;
3+
{ bytecode; }
4+
{ native; }
45
*)
56

67
open Domain

0 commit comments

Comments
 (0)