diff options
-rw-r--r-- | test/fiber/test_io.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/fiber/test_io.rb b/test/fiber/test_io.rb index bf200061d8..90ac4aa5cd 100644 --- a/test/fiber/test_io.rb +++ b/test/fiber/test_io.rb @@ -39,4 +39,27 @@ class TestFiberIO < Test::Unit::TestCase assert_predicate(i, :closed?) assert_predicate(o, :closed?) end + + def test_heavy_read + skip unless defined?(UNIXSocket) + + 16.times.map do + thread = Thread.new do + i, o = UNIXSocket.pair + + scheduler = Scheduler.new + Thread.current.scheduler = scheduler + + Fiber do + message = i.read(20) + i.close + end + + Fiber do + o.write("Hello World") + o.close + end + end + end.each(&:join) + end end |