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 a435e2a7..f16a05de 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 a0d31684..ee3425c1 100644 --- a/test/helpers/integration.rb +++ b/test/helpers/integration.rb @@ -204,7 +204,7 @@ class TestIntegration < Minitest::Test 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 d7c406bc..296c6021 100644 --- a/test/test_busy_worker.rb +++ b/test/test_busy_worker.rb @@ -9,6 +9,7 @@ class TestBusyWorker < Minitest::Test 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 1d39fb04..5cdb9aad 100644 --- a/test/test_integration_single.rb +++ b/test/test_integration_single.rb @@ -165,9 +165,17 @@ class TestIntegrationSingle < TestIntegration 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