Skip to content

Commit

Permalink
ARROW-4704: [GLib][CI] Ensure killing plasma_store_server
Browse files Browse the repository at this point in the history
Author: Kouhei Sutou <[email protected]>

Closes apache#3794 from kou/glib-plasma-test and squashes the following commits:

43f19b3 <Kouhei Sutou>  Ensure killing plasma_store_server
8022faf <Kouhei Sutou>  Ensure killing plasma_store_server
  • Loading branch information
kou committed Mar 3, 2019
1 parent fd0e7ba commit 95b33ef
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions c_glib/test/helper/plasma-store.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ def start
def stop
return if @pid.nil?
Process.kill(:TERM, @pid)
timeout = 1
limit = Time.now + timeout
while Time.now < limit
return if Process.waitpid(@pid, Process::WNOHANG)
sleep(0.1)
end
Process.kill(:KILL, @pid)
Process.waitpid(@pid)
end
end
Expand Down
7 changes: 7 additions & 0 deletions ruby/red-plasma/test/helper/plasma-store.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ def start
def stop
return if @pid.nil?
Process.kill(:TERM, @pid)
timeout = 1
limit = Time.now + timeout
while Time.now < limit
return if Process.waitpid(@pid, Process::WNOHANG)
sleep(0.1)
end
Process.kill(:KILL, @pid)
Process.waitpid(@pid)
end
end
Expand Down

0 comments on commit 95b33ef

Please sign in to comment.