Skip to content

Commit

Permalink
Fix Process spec to wait on started processes (#12941)
Browse files Browse the repository at this point in the history
  • Loading branch information
straight-shoota authored Jan 13, 2023
1 parent 1273855 commit c4e8c21
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion spec/std/process_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -321,13 +321,18 @@ describe Process do
pending_win32 "kills a process" do
process = Process.new(*standing_command)
process.signal(Signal::KILL).should be_nil
ensure
process.try &.wait
end

pending_win32 "kills many process" do
process1 = Process.new(*standing_command)
process2 = Process.new(*standing_command)
process1.signal(Signal::KILL).should be_nil
process2.signal(Signal::KILL).should be_nil
ensure
process1.try &.wait
process2.try &.wait
end
end

Expand All @@ -337,7 +342,8 @@ describe Process do
process.terminated?.should be_false

process.terminate
process.wait
ensure
process.try(&.wait)
end

pending_win32 ".exists?" do
Expand Down Expand Up @@ -367,6 +373,8 @@ describe Process do
Process.pgid(process.pid).should be_a(Int64)
process.signal(Signal::KILL)
Process.pgid.should eq(Process.pgid(Process.pid))
ensure
process.try(&.wait)
end

{% unless flag?(:preview_mt) || flag?(:win32) %}
Expand Down

0 comments on commit c4e8c21

Please sign in to comment.