Skip to content

Commit 96af352

Browse files
committed
More permissive assertions to avoid flakiness
1 parent a818877 commit 96af352

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

test/test_stdio.ml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -113,17 +113,11 @@ let test_select () =
113113

114114
Flock.terminate ();
115115

116-
let expected = [| "Inn1"; "Inn2"; "Timeout" |] in
117-
let actual =
118-
(* Ignore additional timeouts *)
119-
Array.sub
120-
(Array.of_seq
121-
(Picos_mpscq.pop_all events |> Seq.drop_while (( = ) "Timeout")))
122-
0 (Array.length expected)
123-
in
116+
let events = Picos_mpscq.pop_all events in
124117

125-
(* This is non-deterministic and might need to be changed if flaky *)
126-
Alcotest.(check' (array string)) ~msg:"events" ~actual ~expected
118+
assert (Seq.exists (( = ) "Timeout") events);
119+
assert (
120+
List.of_seq (Seq.filter (( <> ) "Timeout") events) = [ "Inn1"; "Inn2" ])
127121

128122
let () =
129123
[

0 commit comments

Comments
 (0)