From a192434909513a0e77b6837ef208f627e502bed2 Mon Sep 17 00:00:00 2001 From: MSP-Greg Date: Tue, 2 Mar 2021 09:56:11 -0600 Subject: [PATCH] Fix CI (#2561) 1. Add racc to Gemfile for JRuby RuboCop 2. test_busy_worker - skip teardown 3. test_integration_single - patch from PR 2560 --- Gemfile | 2 ++ test/helpers/integration.rb | 2 +- test/test_busy_worker.rb | 1 + test/test_integration_single.rb | 14 +++++++++++--- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/Gemfile b/Gemfile index a435e2a7a2..f16a05deeb 100644 --- a/Gemfile +++ b/Gemfile @@ -15,6 +15,8 @@ gem "minitest-stub-const" gem "sd_notify" gem "jruby-openssl", :platform => "jruby" +# needed for rubocop +gem "racc", :platform => "jruby" gem "rubocop", "~> 0.58.0" diff --git a/test/helpers/integration.rb b/test/helpers/integration.rb index a0d3168444..ee3425c121 100644 --- a/test/helpers/integration.rb +++ b/test/helpers/integration.rb @@ -204,7 +204,7 @@ def hot_restart_does_not_drop_connections(num_threads: 1, total_requests: 500) args = "-w #{workers} -t 0:5 -q test/rackup/hello_with_delay.ru" if Puma.windows? @control_tcp_port = UniquePort.call - cli_server "#{args} --control-url tcp://#{HOST}:#{@control_tcp_port} --control-token #{TOKEN}" + cli_server "--control-url tcp://#{HOST}:#{@control_tcp_port} --control-token #{TOKEN} #{args}" else cli_server args end diff --git a/test/test_busy_worker.rb b/test/test_busy_worker.rb index d7c406bcb7..296c602121 100644 --- a/test/test_busy_worker.rb +++ b/test/test_busy_worker.rb @@ -9,6 +9,7 @@ def setup end def teardown + return if skipped? @server.stop(true) if @server @ios.each {|i| i.close unless i.closed?} end diff --git a/test/test_integration_single.rb b/test/test_integration_single.rb index 1d39fb0483..5cdb9aad8f 100644 --- a/test/test_integration_single.rb +++ b/test/test_integration_single.rb @@ -165,9 +165,17 @@ def test_puma_started_log_writing end def test_application_logs_are_flushed_on_write - cli_server 'test/rackup/write_to_stdout.ru' + @control_tcp_port = UniquePort.call + cli_server "--control-url tcp://#{HOST}:#{@control_tcp_port} --control-token #{TOKEN} test/rackup/write_to_stdout.ru" + read_body connect - log_line = @server.gets - assert_equal "hello\n", log_line + + cli_pumactl 'stop' + + assert_equal "hello\n", @server.gets + assert_includes @server.read, 'Goodbye!' + + @server.close unless @server.closed? + @server = nil end end