Skip to content

Commit

Permalink
Failing test case.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Dec 15, 2024
1 parent 6edd6dd commit b41c944
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions test/io/event/selector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,32 @@ def transfer
expect(events).to be == [:process_finished]
expect(result).to be(:success?)
end

it "can wait for two processes sequentially" do
result1 = result2 = nil
events = []

fiber = Fiber.new do
pid1 = Process.spawn("sleep 0.001")
pid2 = Process.spawn("sleep 0.001")

result1 = selector.process_wait(Fiber.current, pid1, 0)
events << :process_finished1

result2 = selector.process_wait(Fiber.current, pid2, 0)
events << :process_finished2
end

fiber.transfer

while fiber.alive?
selector.select(0)
end

expect(events).to be == [:process_finished1, :process_finished2]
expect(result1).to be(:success?)
expect(result2).to be(:success?)
end
end

with "#resume" do
Expand Down

0 comments on commit b41c944

Please sign in to comment.