Skip to content

Commit

Permalink
Process.detach needs to use status, not waitpid result.
Browse files Browse the repository at this point in the history
I also got MRI's test_process and test_open3 running and updated
with appropriate excludes.

Fixes #2494.
  • Loading branch information
headius committed Jan 22, 2015
1 parent cbd3d7b commit e474984
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 53 deletions.
2 changes: 1 addition & 1 deletion core/src/main/java/org/jruby/RubyProcess.java
Expand Up @@ -1094,7 +1094,7 @@ public IRubyObject call(ThreadContext context, IRubyObject[] args, Block block)
Ruby runtime = context.runtime;
int result = checkErrno(runtime, runtime.getPosix().waitpid(pid, status, 0));

return RubyStatus.newProcessStatus(runtime, result, pid);
return RubyStatus.newProcessStatus(runtime, status[0], pid);
}
};

Expand Down
2 changes: 1 addition & 1 deletion test/mri.index
Expand Up @@ -69,7 +69,7 @@ ruby/test_primitive.rb
# TODO 2.1 parser
#ruby/test_proc.rb
# hangs when run with other tests
#ruby/test_process.rb
ruby/test_process.rb
ruby/test_rand.rb
ruby/test_range.rb
ruby/test_rational.rb
Expand Down
22 changes: 0 additions & 22 deletions test/mri/excludes/TestOpen3.rb
@@ -1,23 +1 @@
exclude :test_block, ""
exclude :test_capture2, "hangs"
exclude :test_capture2_stdin_data, "fails"
exclude :test_capture2e, "error"
exclude :test_capture2e_stdin_data, "fails"
exclude :test_capture3, ""
exclude :test_capture3_flip, ""
exclude :test_capture3_stdin_data, "fails"
exclude :test_commandline, ""
exclude :test_exit_status, ""
exclude :test_noblock, ""
exclude :test_pid, ""
exclude :test_pipeline, "error"
exclude :test_pipeline_r, "hangs"
exclude :test_pipeline_rw, "hangs"
exclude :test_pipeline_start, "error"
exclude :test_pipeline_start_noblock, "error"
exclude :test_pipeline_w, "hangs"
exclude :test_popen2, "hangs"
exclude :test_popen2e, "error"
exclude :test_stderr, ""
exclude :test_stdin, "error"
exclude :test_stdout, ""
65 changes: 36 additions & 29 deletions test/mri/excludes/TestProcess.rb
@@ -1,45 +1,52 @@
exclude :test_abort, "needs investigation"
exclude :test_argv0, "needs investigation"
exclude :test_argv0_noarg, "needs investigation"
exclude :test_argv0_noarg, "hangs"
exclude :test_aspawn_too_long_path, "out of memory error"
exclude :test_clock_getres_CLOCK_BASED_CLOCK_PROCESS_CPUTIME_ID, "missing process timing functionality"
exclude :test_clock_getres_GETTIMEOFDAY_BASED_CLOCK_REALTIME, "missing process timing functionality"
exclude :test_clock_getres_TIME_BASED_CLOCK_REALTIME, "missing process timing functionality"
exclude :test_clock_gettime_CLOCK_BASED_CLOCK_PROCESS_CPUTIME_ID, "missing process timing functionality"
exclude :test_clock_gettime_GETTIMEOFDAY_BASED_CLOCK_REALTIME, "missing process timing functionality"
exclude :test_clock_gettime_TIME_BASED_CLOCK_REALTIME, "missing process timing functionality"
exclude :test_clock_gettime_unit, "missing process timing functionality"
exclude :test_deadlock_by_signal_at_forking, "uses fork"
exclude :test_exec_noshell, "needs investigation"
exclude :test_exec_shell, "needs investigation"
exclude :test_exec_wordsplit, "needs investigation"
exclude :test_execopts_chdir, "needs investigation"
exclude :test_execopts_close_others, "needs investigation"
exclude :test_execopts_duplex_io, "needs investigation"
exclude :test_execopts_env, "needs investigation"
exclude :test_execopts_env_popen_string, "needs investigation"
exclude :test_execopts_env_popen_vector, "needs investigation"
exclude :test_execopts_env_single_word, "out of memory error"
exclude :test_execopts_exec, "needs investigation"
exclude :test_execopts_modification, "needs investigation"
exclude :test_execopts_opts, "needs investigation"
exclude :test_execopts_gid, "needs investigation"
exclude :test_execopts_open_chdir, "out of memory error"
exclude :test_execopts_pgroup, "needs investigation"
exclude :test_execopts_popen, "needs investigation"
exclude :test_execopts_redirect, "needs investigation"
exclude :test_execopts_redirect_dup2_child, "needs investigation"
exclude :test_execopts_redirect_self, "needs investigation"
exclude :test_execopts_rlimit, "needs investigation"
exclude :test_execopts_umask, "needs investigation"
exclude :test_execopts_unsetenv_others, "needs investigation"
exclude :test_execopts_preserve_env_on_exec_failure, "needs investigation"
exclude :test_execopts_redirect, "out of memory error"
exclude :test_execopts_redirect_dup2_child, "out of memory error"
exclude :test_execopts_redirect_nonascii_path, "out of memory error"
exclude :test_execopts_redirect_to_out_and_err, "out of memory error"
exclude :test_execopts_uid, "needs investigation"
exclude :test_execopts_umask, "unsupported"
exclude :test_execopts_unsetenv_others, "unsupported"
exclude :test_fallback_to_sh, "needs investigation"
exclude :test_fd_inheritance, "needs investigation"
exclude :test_geteuid, "needs investigation"
exclude :test_gid_re_exchangeable_p, "needs investigation"
exclude :test_gid_sid_available?, "needs investigation"
exclude :test_no_curdir, "needs investigation"
exclude :test_popen_noshell, "needs investigation"
exclude :test_popen_shell, "needs investigation"
exclude :test_gid_re_exchangeable_p, "unimplemented"
exclude :test_gid_sid_available?, "unimplemented"
exclude :test_no_curdir, "out of memory error"
exclude :test_popen_cloexec, "unsupported"
exclude :test_popen_wordsplit, "needs investigation"
exclude :test_pst_inspect, "needs investigation"
exclude :test_popen_wordsplit_beginning_and_trailing_spaces, "needs investigation"
exclude :test_process_detach, "uses fork"
exclude :test_pst_inspect, "uses Process::Status allocator"
exclude :test_seteuid_name, "argument coersion error"
exclude :test_sh_exec, "needs investigation"
exclude :test_spawn_noshell, "needs investigation"
exclude :test_spawn_shell, "needs investigation"
exclude :test_spawn_too_long_path, "out of memory error"
exclude :test_spawn_wordsplit, "needs investigation"
exclude :test_status, "needs investigation"
exclude :test_status_kill, "needs investigation"
exclude :test_system_shell, "needs investigation"
exclude :test_system_sigpipe, "needs investigation"
exclude :test_status_quit, "needs investigation"
exclude :test_system_wordsplit, "needs investigation"
exclude :test_too_long_path, "works, but dumps a massive amount of text to stdout"
exclude :test_uid_re_exchangeable_p, "needs investigation"
exclude :test_uid_sid_available?, "needs investigation"
exclude :test_wait2, "needs investigation"
exclude :test_wait_without_arg, "needs investigation"
exclude :test_waitall, "needs investigation"
exclude :test_uid_re_exchangeable_p, "unimplemented"
exclude :test_uid_sid_available?, "unimplemented"

0 comments on commit e474984

Please sign in to comment.