Skip to content

Commit b1c6cf6

Browse files
committed
Remove race condition from test.
1 parent de35b62 commit b1c6cf6

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

fixtures/async/http/body/a_writable_body.rb

+4-9
Original file line numberDiff line numberDiff line change
@@ -86,21 +86,16 @@ module Body
8686
}.to raise_exception(RuntimeError, message: be =~ /big/)
8787
end
8888

89-
it "will stop after finishing" do
90-
output_task = reactor.async do
91-
body.each do |chunk|
92-
expect(chunk).to be == "Hello World!"
93-
end
94-
end
95-
89+
it "can consume chunks" do
9690
body.write("Hello World!")
9791
body.close
9892

9993
expect(body).not.to be(:empty?)
10094

101-
::Async::Task.current.yield
95+
body.each do |chunk|
96+
expect(chunk).to be == "Hello World!"
97+
end
10298

103-
expect(output_task).to be(:finished?)
10499
expect(body).to be(:empty?)
105100
end
106101
end

0 commit comments

Comments
 (0)