On Windows, Process.wait is not setting $? (or $CHILD_STATUS) and Process.wait2 is returning nil.
This is happening within my GitHub Actions. I created a simple test here that shows the behavior:
https://github.com/jcouball/process_spawn_test/actions/runs/3632082827
This workflow is a matrix build that runs the tests on two different JRuby and MRI versions on both Ubuntu and Windows. Only the JRuby builds on Windows fail.
The test code is very simple and can be found here:
https://github.com/jcouball/process_spawn_test/blob/main/spec/test_spec.rb
Duplicated here:
require 'English' describe 'Process#wait' do it 'should set the global $CHILD_STATUS variable' do pid = Process.spawn('exit 0') Process.wait(pid) expect($CHILD_STATUS).not_to be_nil expect($CHILD_STATUS.pid).to eq(pid) end end describe 'Process#wait2' do it 'should return a non-nil status' do pid = Process.spawn('exit 0') exited_pid, status = Process.wait2(pid) expect(status).not_to be_nil expect(status.pid).to eq(pid) end end
I suspect this might be a configuration error with the Windows image I am using. I don't have access to a Windows computer or virtual environment so can't debug it on my own. Also, my Windows experience is rusty.
Environment Information
The environment where I am seeing unexpected behavior:
rspec
gemEnvironments where I see the expected behavior:
Expected Behavior
Process.wait
should set $? / $CHILD_STATUSProcess.wait2
should return [pid, status] instead of nil.Actual Behavior
Process.wait
, $? / $CHILD_STATUS is nil.Process.wait2
is returning nil instead of [pid, status].RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4