| ... | @@ -4230,3 +4230,25 @@ fn expect_buf_grp_cqe( | ... | @@ -4230,3 +4230,25 @@ fn expect_buf_grp_cqe( |
| 4230 | | 4230 | |
| 4231 | return cqe; | 4231 | return cqe; |
| 4232 | } | 4232 | } |
| | 4233 | |
| | 4234 | test "failing test for issue 19451" { |
| | 4235 | var ring = try IoUring.init(2, 0); |
| | 4236 | defer ring.deinit(); |
| | 4237 | |
| | 4238 | try testing.expectEqual(2, ring.sq.sqes.len); |
| | 4239 | try testing.expectEqual(4, ring.cq.cqes.len); |
| | 4240 | |
| | 4241 | for (0..4) |i| { |
| | 4242 | const sqe = try ring.get_sqe(); |
| | 4243 | sqe.prep_timeout(&.{ .tv_sec = 0, .tv_nsec = 10000 }, 0, 0); |
| | 4244 | sqe.user_data = i; |
| | 4245 | _ = try ring.submit(); |
| | 4246 | } |
| | 4247 | |
| | 4248 | var cqe_count: u32 = 0; |
| | 4249 | while (cqe_count < 4) { |
| | 4250 | var cqes: [8]linux.io_uring_cqe = undefined; |
| | 4251 | cqe_count += try ring.copy_cqes(&cqes, 4 - cqe_count); |
| | 4252 | } |
| | 4253 | try testing.expectEqual(4, cqe_count); |
| | 4254 | } |