diff options
author | Eric Wong <e@yhbt.net> | 2013-09-03 22:43:04 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2013-09-03 23:35:15 +0000 |
commit | 259347346169d4a2ab5b33719fe0985edc64bd3c (patch) | |
tree | 038af5dbd37ca27cef87cd093f7cf840e9adbf2e | |
parent | dae148a9d6de7501acf8a68218b3e9d2c5ff6ff7 (diff) | |
download | kgio-259347346169d4a2ab5b33719fe0985edc64bd3c.tar.gz |
Linux pipe buffers may use larger pages and increase the capacity of pipes. Thus the 10000 write attempt is not sufficient; just infinite loop until we hit :wait_writable.
-rw-r--r-- | test/lib_read_write.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/test/lib_read_write.rb b/test/lib_read_write.rb index 7df9a79..5034db8 100644 --- a/test/lib_read_write.rb +++ b/test/lib_read_write.rb @@ -456,10 +456,12 @@ module LibReadWriteTest def @wr.kgio_wait_writable raise "Hello" end - tmp = [] - buf = "." * 1024 - 10000.times { tmp << @wr.kgio_trywrite(buf) } - assert_equal :wait_writable, tmp.pop + buf = "." * 4096 + rv = nil + until rv == :wait_writable + rv = @wr.kgio_trywrite(buf) + end + assert_equal :wait_writable, rv end def test_wait_writable_method |