Skip to content

Commit ce98621

Browse files
committed
Avoid buffering issues.
1 parent 3bd7a66 commit ce98621

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

test/io/stream/buffered.rb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -825,10 +825,11 @@ def before
825825
client.close
826826

827827
task = reactor.async do
828-
server.write("Hello")
829-
server.flush
830-
server.write("World")
831-
server.flush
828+
# We do this as triggering EPIPE may require us to flush the network buffers:
829+
100.times do
830+
server.write("Hello World" * 1024)
831+
server.flush
832+
end
832833
rescue Errno::EPIPE => error
833834
error
834835
rescue Errno::ECONNRESET => error

0 commit comments

Comments
 (0)