1
0
Fork 0
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:
MSP-Greg 2020-10-27 08:37:43 -05:00 committed by GitHub
parent 288a4cf756
commit 301a60d079
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -179,14 +179,17 @@ class TestIntegration < Minitest::Test
end
def cli_pumactl(argv, unix: false)
if unix
pumactl = IO.popen("#{BASE} bin/pumactl -C unix://#{@control_path} -T #{TOKEN} #{argv}", "r")
else
pumactl = IO.popen("#{BASE} bin/pumactl -C tcp://#{HOST}:#{@control_tcp_port} -T #{TOKEN} #{argv}", "r")
end
@ios_to_close << pumactl
Process.wait pumactl.pid
pumactl
arg =
if unix
%W[-C unix://#{@control_path} -T #{TOKEN} #{argv}]
else
%W[-C tcp://#{HOST}:#{@control_tcp_port} -T #{TOKEN} #{argv}]
end
r, w = IO.pipe
Thread.new { Puma::ControlCLI.new(arg, w, w).run }.join
w.close
@ios_to_close << r
r
end
def hot_restart_does_not_drop_connections(num_threads: 1, total_requests: 500)
@ -250,7 +253,7 @@ class TestIntegration < Minitest::Test
end
end
end
# STDOUT.puts "#{thread} #{replies[:success]}"
# STDOUT.puts "#{thread} #{replies[:success]}"
end
end