diff options
author | Takashi Kokubun <takashikkbn@gmail.com> | 2020-05-10 00:52:54 -0700 |
---|---|---|
committer | Takashi Kokubun <takashikkbn@gmail.com> | 2020-05-10 00:59:55 -0700 |
commit | 967ae6278f8429dc268f8d3252de048eba86fe29 (patch) | |
tree | f2af0853cf4476e5b649bfa97bd2a92bc3f54b4d /test/ruby/test_process.rb | |
parent | 50a6d292c0ebfc2f35ee66efbb3b7ea44d5a0f94 (diff) |
Run rb_syswait on exec failure
not only when !w but also when w == WAITPID_LOCK_ONLY.
See also: f7c0cc36920a4ed14a3ab1ca6cfdf18ceff1e5d5 and a2264342063260d660b99872eaf5080f6ab08e81.
We thought this change was an oversight in the latter commit.
Without this change, the test fails like:
$ make test-all TESTS="../test/ruby/test_process.rb -n test_exec_failure_leaves_no_child" RUN_OPTS="--jit"
...
1) Failure:
TestProcess#test_exec_failure_leaves_no_child [/home/k0kubun/src/github.com/ruby/ruby/test/ruby/test_process.rb:2493]:
Expected [[26799, #<Process::Status: pid 26799 exit 127>]] to be empty.
Co-Authored-By: Yusuke Endoh <mame@ruby-lang.org>
Diffstat (limited to 'test/ruby/test_process.rb')
-rw-r--r-- | test/ruby/test_process.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb index 7bcfa48f4f..9d0ee6708a 100644 --- a/test/ruby/test_process.rb +++ b/test/ruby/test_process.rb @@ -2485,4 +2485,11 @@ EOS Process.wait spawn(RUBY, "-e", "exit 13") assert_same(Process.last_status, $?) end + + def test_exec_failure_leaves_no_child + assert_raise(Errno::ENOENT) do + spawn('inexistent_command') + end + assert_empty(Process.waitall) + end end |