1
+ exception Skip_test of string
2
+ let skip _stdenv =
3
+ raise (Skip_test " io_uring not available in Docker" )
4
+
1
5
open Eio.Std
2
6
3
7
module Trace = Eio.Private. Trace
@@ -19,7 +23,7 @@ let read_one_byte ~sw r =
19
23
)
20
24
21
25
let test_poll_add () =
22
- Eio_linux. run @@ fun _stdenv ->
26
+ Eio_linux. run ~fallback: skip ( fun _stdenv ->
23
27
Switch. run @@ fun sw ->
24
28
let r, w = Eio_unix. pipe sw in
25
29
let thread = read_one_byte ~sw r in
@@ -32,10 +36,10 @@ let test_poll_add () =
32
36
assert (sent = 1 );
33
37
let result = Promise. await_exn thread in
34
38
Alcotest. (check string ) " Received data" " !" result
35
-
39
+ )
36
40
let test_poll_add_busy () =
37
- Eio_linux. run ~queue_depth: 2 @@ fun _stdenv ->
38
- Switch. run @@ fun sw ->
41
+ Eio_linux. run ~queue_depth: 2 ~fallback: skip ( fun _stdenv ->
42
+ Switch. run @@ fun sw ->
39
43
let r, w = Eio_unix. pipe sw in
40
44
let a = read_one_byte ~sw r in
41
45
let b = read_one_byte ~sw r in
@@ -50,7 +54,7 @@ let test_poll_add_busy () =
50
54
Alcotest. (check string ) " Received data" " !" a;
51
55
let b = Promise. await_exn b in
52
56
Alcotest. (check string ) " Received data" " !" b
53
-
57
+ )
54
58
(* Write a string to a pipe and read it out again. *)
55
59
let test_copy () =
56
60
Eio_linux. run ~queue_depth: 3 @@ fun _stdenv ->
@@ -259,4 +263,4 @@ let () =
259
263
test_case " signal_race" `Quick test_signal_race;
260
264
test_case " alloc-fixed-or-wait" `Quick test_alloc_fixed_or_wait;
261
265
];
262
- ]
266
+ ]
0 commit comments