summaryrefslogtreecommitdiff
path: root/test/io/console
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-12-23 14:31:56 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-12-23 14:31:56 +0000
commitac40fc997b6b27c4f61084d9f6fae83ea251d614 (patch)
tree6dce25e7744b8686088500a65a99901b31f217dd /test/io/console
parenteb8c2773cb57628c09b36243d74cb752327819a6 (diff)
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
Diffstat (limited to 'test/io/console')
-rw-r--r--test/io/console/test_io_console.rb4
1 files changed, 3 insertions, 1 deletions
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