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

ruby-changes:49309

From: nobu <ko1@a...>
Date: Sat, 23 Dec 2017 23:32:02 +0900 (JST)
Subject: [ruby-changes:49309] nobu:r61426 (trunk): test_io_console.rb: get rid of sporadic failures

nobu	2017-12-23 23:31:56 +0900 (Sat, 23 Dec 2017)

  New Revision: 61426

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

  Log:
    test_io_console.rb: get rid of sporadic failures
    
    * test/io/console/test_io_console.rb (test_getpass): try to get
      rid of timing issues.
    
    * test/io/console/test_io_console.rb (test_ioflush2): ditto.

  Modified files:
    trunk/test/io/console/test_io_console.rb
Index: test/io/console/test_io_console.rb
===================================================================
--- test/io/console/test_io_console.rb	(revision 61425)
+++ test/io/console/test_io_console.rb	(revision 61426)
@@ -188,8 +188,9 @@ defined?(PTY) and defined?(IO.console) a https://github.com/ruby/ruby/blob/trunk/test/io/console/test_io_console.rb#L188
     skip unless IO.method_defined?("getpass")
     run_pty("p IO.console.getpass('> ')") do |r, w|
       assert_equal("> ", r.readpartial(10))
+      sleep 0.1
       w.print "asdf\n"
-      sleep 1
+      sleep 0.1
       assert_equal("\r\n", r.gets)
       assert_equal("\"asdf\"", r.gets.chomp)
     end
@@ -231,6 +232,7 @@ defined?(PTY) and defined?(IO.console) a https://github.com/ruby/ruby/blob/trunk/test/io/console/test_io_console.rb#L232
       s.ioflush # ioflush may be issued after "a" is already sent.
       s.print "b"
       s.flush
+      sleep 0.1
       assert_include(["b", "ab"], m.readpartial(10))
     }
   end

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

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