diff --git a/spec/async_watcher_spec.rb b/spec/async_watcher_spec.rb index 486d4da..2750a62 100644 --- a/spec/async_watcher_spec.rb +++ b/spec/async_watcher_spec.rb @@ -30,7 +30,9 @@ end # ensure children are ready - nr_fork.times { expect(rd.sysread(1)).to eq('.') } + # rd may be O_NONBLOCK on macOS Ruby 3.2+ (IO.pipe sets O_NONBLOCK); use read + # instead of sysread so EAGAIN on an empty pipe is retried transparently. + nr_fork.times { expect(rd.read(1)).to eq('.') } # send our signals nr_signal.times { aw.signal }