Skip to content

Commit

Permalink
Fix CI (puma#2561)
Browse files Browse the repository at this point in the history
1. Add racc to Gemfile for JRuby RuboCop
2. test_busy_worker - skip teardown
3. test_integration_single - patch from PR 2560
  • Loading branch information
MSP-Greg committed Mar 2, 2021
1 parent 7970d14 commit a192434
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
2 changes: 2 additions & 0 deletions Gemfile
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion test/helpers/integration.rb
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions test/test_busy_worker.rb
Expand Up @@ -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
Expand Down
14 changes: 11 additions & 3 deletions test/test_integration_single.rb
Expand Up @@ -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

0 comments on commit a192434

Please sign in to comment.