diff options
author | aycabta <aycabta@gmail.com> | 2021-08-10 06:54:32 +0900 |
---|---|---|
committer | aycabta <aycabta@gmail.com> | 2021-08-11 14:08:45 +0900 |
commit | 67e06102a3c8d0b8e8ff7a6f0528016f2560fd4b (patch) | |
tree | dbb4ae1b424ef6341bf913d3cd352c6d44c50fa0 /test/readline | |
parent | 7b10f55354331e2807eb86cd99321558e727ff0d (diff) |
Stop checking char from "read"
Because it's sometimes nil due to race condition.
Diffstat (limited to 'test/readline')
-rw-r--r-- | test/readline/test_readline.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/test/readline/test_readline.rb b/test/readline/test_readline.rb index 3661aace15..c0f1b30925 100644 --- a/test/readline/test_readline.rb +++ b/test/readline/test_readline.rb @@ -520,14 +520,16 @@ module BasetestReadline EnvUtil.invoke_ruby(["-I#{__dir__}", script.path], "", true, :merge_to_stdout) do |_in, _out, _, pid| Timeout.timeout(TIMEOUT) do log << "** START **" - while c = _out.read(1) + loop do + c = _out.read(1) log << c if c break if log.include?('input>') end log << "** SIGINT **" Process.kill(:INT, pid) sleep 0.1 - while c = _out.read(1) + loop do + c = _out.read(1) log << c if c break if log.include?('TRAP') end @@ -537,7 +539,8 @@ module BasetestReadline rescue Errno::EPIPE # The "write" will fail if Reline crashed by SIGINT. end - while c = _out.read(1) + loop do + c = _out.read(1) log << c if c if log.include?('FAILED') assert false, "Should handle SIGINT correctly but raised interrupt.\nLog: #{log}\n----" |