[前][次][番号順一覧][スレッド一覧]

ruby-changes:53977

From: k0kubun <ko1@a...>
Date: Tue, 4 Dec 2018 20:45:10 +0900 (JST)
Subject: [ruby-changes:53977] k0kubun:r66197 (trunk): Re-commit r65722

k0kubun	2018-12-04 20:45:05 +0900 (Tue, 04 Dec 2018)

  New Revision: 66197

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=66197

  Log:
    Re-commit r65722
    
    which was accidentally reverted by r65904
    
    158562dabb197d6efc53cabe6662177c6ec3f43e

  Modified files:
    trunk/test/rubygems/test_gem_stream_ui.rb
Index: test/rubygems/test_gem_stream_ui.rb
===================================================================
--- test/rubygems/test_gem_stream_ui.rb	(revision 66196)
+++ test/rubygems/test_gem_stream_ui.rb	(revision 66197)
@@ -4,6 +4,7 @@ require 'rubygems/user_interaction' https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_stream_ui.rb#L4
 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
@@ -47,7 +48,7 @@ class TestGemStreamUI < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_stream_ui.rb#L48
   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
@@ -65,7 +66,7 @@ class TestGemStreamUI < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_stream_ui.rb#L66
   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
@@ -74,7 +75,7 @@ class TestGemStreamUI < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_stream_ui.rb#L75
   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
 
@@ -86,7 +87,7 @@ class TestGemStreamUI < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_stream_ui.rb#L87
   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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]