The unpac monorepo manager self-hosting as a monorepo using unpac
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Skip test_alloc_fixed_or_wait if no fixed buffers are available

Prevents spurious CI failures.

+31 -29
+31 -29
lib_eio_linux/tests/test.ml
··· 213 213 214 214 let test_alloc_fixed_or_wait () = 215 215 Eio_linux.run ~n_blocks:1 @@ fun _env -> 216 - let block = Eio_linux.Low_level.alloc_fixed_or_wait () in 217 - (* We have to wait for the block, but get cancelled while waiting. *) 218 - begin 219 - try 220 - Fiber.both 221 - (fun () -> ignore (Eio_linux.Low_level.alloc_fixed_or_wait () : Uring.Region.chunk)) 222 - (fun () -> raise Exit); 223 - with Exit -> () 224 - end; 225 - (* We have to wait for the block, and get it when the old one is freed. *) 226 - Fiber.both 227 - (fun () -> 228 - let x = Eio_linux.Low_level.alloc_fixed_or_wait () in 229 - Eio_linux.Low_level.free_fixed x 230 - ) 231 - (fun () -> 232 - Eio_linux.Low_level.free_fixed block 233 - ); 234 - (* The old block is passed to the waiting fiber, but it's cancelled. *) 235 - let block = Eio_linux.Low_level.alloc_fixed_or_wait () in 236 - Fiber.both 237 - (fun () -> 238 - Fiber.first 239 - (fun () -> ignore (Eio_linux.Low_level.alloc_fixed_or_wait ()); assert false) 240 - (fun () -> ()) 241 - ) 242 - (fun () -> Eio_linux.Low_level.free_fixed block); 243 - let block = Eio_linux.Low_level.alloc_fixed_or_wait () in 244 - Eio_linux.Low_level.free_fixed block 216 + match Eio_linux.Low_level.alloc_fixed_or_wait () with 217 + | exception (Failure "No fixed buffer available") [@warning "-52"] -> Alcotest.skip () 218 + | block -> 219 + (* We have to wait for the block, but get cancelled while waiting. *) 220 + begin 221 + try 222 + Fiber.both 223 + (fun () -> ignore (Eio_linux.Low_level.alloc_fixed_or_wait () : Uring.Region.chunk)) 224 + (fun () -> raise Exit); 225 + with Exit -> () 226 + end; 227 + (* We have to wait for the block, and get it when the old one is freed. *) 228 + Fiber.both 229 + (fun () -> 230 + let x = Eio_linux.Low_level.alloc_fixed_or_wait () in 231 + Eio_linux.Low_level.free_fixed x 232 + ) 233 + (fun () -> 234 + Eio_linux.Low_level.free_fixed block 235 + ); 236 + (* The old block is passed to the waiting fiber, but it's cancelled. *) 237 + let block = Eio_linux.Low_level.alloc_fixed_or_wait () in 238 + Fiber.both 239 + (fun () -> 240 + Fiber.first 241 + (fun () -> ignore (Eio_linux.Low_level.alloc_fixed_or_wait ()); assert false) 242 + (fun () -> ()) 243 + ) 244 + (fun () -> Eio_linux.Low_level.free_fixed block); 245 + let block = Eio_linux.Low_level.alloc_fixed_or_wait () in 246 + Eio_linux.Low_level.free_fixed block 245 247 246 248 let () = 247 249 let open Alcotest in