From ac40fc997b6b27c4f61084d9f6fae83ea251d614 Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 23 Dec 2017 14:31:56 +0000 Subject: 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61426 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/io/console/test_io_console.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'test/io/console') diff --git a/test/io/console/test_io_console.rb b/test/io/console/test_io_console.rb index fb20308256..764c5e1a61 100644 --- a/test/io/console/test_io_console.rb +++ b/test/io/console/test_io_console.rb @@ -188,8 +188,9 @@ defined?(PTY) and defined?(IO.console) and TestIO_Console.class_eval do 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) and TestIO_Console.class_eval do 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 -- cgit v1.2.3