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 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