Skip to content

Commit

Permalink
(PUP-11897) Add additional mocking to the execution spec
Browse files Browse the repository at this point in the history
With the change in 4f35fd2, the execution tests need to have
mocked out the an addtional call to `waitpid2` that has the
flag set to zero.
  • Loading branch information
tvpartytonight committed Sep 8, 2023
1 parent 104f0ea commit 86bf20b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions spec/unit/util/execution_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ def stub_process_wait(exitstatus)
allow(FFI::WIN32).to receive(:CloseHandle).with(thread_handle)
else
allow(Process).to receive(:waitpid2).with(pid, Process::WNOHANG).and_return(nil, [pid, double('child_status', :exitstatus => exitstatus)])
allow(Process).to receive(:waitpid2).with(pid, 0).and_return(nil, [pid, double('child_status', :exitstatus => exitstatus)])
allow(Process).to receive(:waitpid2).with(pid).and_return([pid, double('child_status', :exitstatus => exitstatus)])
end
end
Expand Down

0 comments on commit 86bf20b

Please sign in to comment.