Skip to content

Commit 7830d3e

Browse files
authored
Failing timeout while getting from stdin. (#266)
1 parent 5311391 commit 7830d3e

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/async/task.rb

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,22 @@ def after
596596
expect(state).to be == :timeout
597597
end
598598

599+
it "will timeout while getting from stdin" do
600+
error = nil
601+
602+
reactor.async do |task|
603+
begin
604+
task.with_timeout(0.1) {STDIN.gets}
605+
rescue Async::TimeoutError => error
606+
# Ignore.
607+
end
608+
end
609+
610+
reactor.run
611+
612+
expect(error).to be_a(Async::TimeoutError)
613+
end
614+
599615
it "won't timeout if execution completes in time" do
600616
state = nil
601617

0 commit comments

Comments
 (0)