Skip to content

Commit

Permalink
test_gem_stream_ui.rb: loosen timeout for --jit-wait
Browse files Browse the repository at this point in the history
https://app.wercker.com/ruby/ruby/runs/mjit-test2/5beba9be183106002852f8a6?step=5bebc1a087436a0006f94a22

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65722 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
k0kubun committed Nov 14, 2018
1 parent c2ef40d commit 158562d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions test/rubygems/test_gem_stream_ui.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
require 'timeout'

class TestGemStreamUI < Gem::TestCase
SHORT_TIMEOUT = (defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled?) ? 1.0 : 0.1 # increase timeout with MJIT for --jit-wait testing

module IsTty
attr_accessor :tty
Expand Down Expand Up @@ -47,7 +48,7 @@ def test_ask
def test_ask_no_tty
@in.tty = false

Timeout.timeout(0.1) do
Timeout.timeout(SHORT_TIMEOUT) do
answer = @sui.ask("what is your favorite color?")
assert_nil answer
end
Expand All @@ -65,7 +66,7 @@ def test_ask_for_password
def test_ask_for_password_no_tty
@in.tty = false

Timeout.timeout(0.1) do
Timeout.timeout(SHORT_TIMEOUT) do
answer = @sui.ask_for_password("what is the airspeed velocity of an unladen swallow?")
assert_nil answer
end
Expand All @@ -74,7 +75,7 @@ def test_ask_for_password_no_tty
def test_ask_yes_no_no_tty_with_default
@in.tty = false

Timeout.timeout(0.1) do
Timeout.timeout(SHORT_TIMEOUT) do
answer = @sui.ask_yes_no("do coconuts migrate?", false)
assert_equal false, answer

Expand All @@ -86,7 +87,7 @@ def test_ask_yes_no_no_tty_with_default
def test_ask_yes_no_no_tty_without_default
@in.tty = false

Timeout.timeout(0.1) do
Timeout.timeout(SHORT_TIMEOUT) do
assert_raises(Gem::OperationNotSupportedError) do
@sui.ask_yes_no("do coconuts migrate?")
end
Expand Down

0 comments on commit 158562d

Please sign in to comment.