diff options
author | Naoto Ono <[email protected]> | 2025-02-03 16:07:19 +0900 |
---|---|---|
committer | GitHub <[email protected]> | 2025-02-03 16:07:19 +0900 |
commit | 8cbff4fe45abbca816867f388c12df19a211e7b9 (patch) | |
tree | e49e64f8def5bc9e9d0cf16fd0bbba5b8334acbc | |
parent | 890020e3922ccb4c2241dc7c2024f8f5bc5e7e91 (diff) |
Add sleep to PTY tests to stabilize flaky failures (#12691)
Notes
Notes:
Merged-By: ono-max <[email protected]>
-rw-r--r-- | test/test_pty.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/test_pty.rb b/test/test_pty.rb index 1c0c6fb3e8..81b0d394ff 100644 --- a/test/test_pty.rb +++ b/test/test_pty.rb @@ -12,7 +12,7 @@ class TestPTY < Test::Unit::TestCase RUBY = EnvUtil.rubybin def test_spawn_without_block - r, w, pid = PTY.spawn(RUBY, '-e', 'puts "a"') + r, w, pid = PTY.spawn(RUBY, '-e', 'puts "a"; sleep 0.1') rescue RuntimeError omit $! else @@ -24,7 +24,7 @@ class TestPTY < Test::Unit::TestCase end def test_spawn_with_block - PTY.spawn(RUBY, '-e', 'puts "b"') {|r,w,pid| + PTY.spawn(RUBY, '-e', 'puts "b"; sleep 0.1') {|r,w,pid| begin assert_equal("b\r\n", r.gets) ensure @@ -38,7 +38,7 @@ class TestPTY < Test::Unit::TestCase end def test_commandline - commandline = Shellwords.join([RUBY, '-e', 'puts "foo"']) + commandline = Shellwords.join([RUBY, '-e', 'puts "foo"; sleep 0.1']) PTY.spawn(commandline) {|r,w,pid| begin assert_equal("foo\r\n", r.gets) @@ -53,7 +53,7 @@ class TestPTY < Test::Unit::TestCase end def test_argv0 - PTY.spawn([RUBY, "argv0"], '-e', 'puts "bar"') {|r,w,pid| + PTY.spawn([RUBY, "argv0"], '-e', 'puts "bar"; sleep 0.1') {|r,w,pid| begin assert_equal("bar\r\n", r.gets) ensure |