mirror of
https://github.com/puma/puma.git
synced 2022-11-09 13:48:40 -05:00
test/helpers/integration.rb - #cli_pumactl - replace popen with thread (#2453)
This commit is contained in:
parent
288a4cf756
commit
301a60d079
1 changed files with 12 additions and 9 deletions
|
@ -179,14 +179,17 @@ class TestIntegration < Minitest::Test
|
||||||
end
|
end
|
||||||
|
|
||||||
def cli_pumactl(argv, unix: false)
|
def cli_pumactl(argv, unix: false)
|
||||||
if unix
|
arg =
|
||||||
pumactl = IO.popen("#{BASE} bin/pumactl -C unix://#{@control_path} -T #{TOKEN} #{argv}", "r")
|
if unix
|
||||||
else
|
%W[-C unix://#{@control_path} -T #{TOKEN} #{argv}]
|
||||||
pumactl = IO.popen("#{BASE} bin/pumactl -C tcp://#{HOST}:#{@control_tcp_port} -T #{TOKEN} #{argv}", "r")
|
else
|
||||||
end
|
%W[-C tcp://#{HOST}:#{@control_tcp_port} -T #{TOKEN} #{argv}]
|
||||||
@ios_to_close << pumactl
|
end
|
||||||
Process.wait pumactl.pid
|
r, w = IO.pipe
|
||||||
pumactl
|
Thread.new { Puma::ControlCLI.new(arg, w, w).run }.join
|
||||||
|
w.close
|
||||||
|
@ios_to_close << r
|
||||||
|
r
|
||||||
end
|
end
|
||||||
|
|
||||||
def hot_restart_does_not_drop_connections(num_threads: 1, total_requests: 500)
|
def hot_restart_does_not_drop_connections(num_threads: 1, total_requests: 500)
|
||||||
|
@ -250,7 +253,7 @@ class TestIntegration < Minitest::Test
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
# STDOUT.puts "#{thread} #{replies[:success]}"
|
# STDOUT.puts "#{thread} #{replies[:success]}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue