Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve reliability of non-MRI CI [changelog skip] #2428

Merged
merged 2 commits into from
Oct 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 3 additions & 6 deletions .github/workflows/non_mri.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,13 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-20.04, ubuntu-18.04, macos-10.15 ]
os: [ ubuntu-20.04, macos-10.15 ]
ruby: [ jruby, jruby-head, truffleruby-head ]
no-ssl: ['']
include:
#- { os: ubuntu-18.04 , ruby: jruby-head, allow-failure: true }
- { os: ubuntu-20.04 , ruby: jruby-head, allow-failure: true }
- { os: ubuntu-20.04 , ruby: jruby, no-ssl: ' no SSL' }
exclude:
- { os: ubuntu-20.04 , ruby: jruby }
- { os: ubuntu-20.04 , ruby: jruby-head }
- { os: ubuntu-20.04 , ruby: truffleruby-head }
- { os: macos-10.15 , ruby: jruby-head }

steps:
Expand Down Expand Up @@ -59,7 +56,7 @@ jobs:

- name: test
id: test
timeout-minutes: 20
timeout-minutes: 15
continue-on-error: ${{ matrix.allow-failure || false }}
if: success() # only run if previous steps have succeeded
run: bundle exec rake test:all
Expand Down
2 changes: 2 additions & 0 deletions test/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ module TestSkips

SIGNAL_LIST = Signal.list.keys.map(&:to_sym) - (Puma.windows? ? [:INT, :TERM] : [])

JRUBY_HEAD = Puma::IS_JRUBY && RUBY_DESCRIPTION =~ /SNAPSHOT/

# usage: skip_unless_signal_exist? :USR2
def skip_unless_signal_exist?(sig, bt: caller)
signal = sig.to_s.sub(/\ASIG/, '').to_sym
Expand Down
3 changes: 2 additions & 1 deletion test/helpers/integration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,8 @@ def hot_restart_does_not_drop_connections(num_threads: 1, total_requests: 500)
# client would see an empty response
# Errno::EBADF Windows may not be able to make a connection
mutex.synchronize { replies[:reset] += 1 }
rescue *refused
rescue *refused, IOError
# IOError intermittently thrown by Ubuntu, add to allow retry
mutex.synchronize { replies[:refused] += 1 }
rescue ::Timeout::Error
mutex.synchronize { replies[:read_timeout] += 1 }
Expand Down
2 changes: 1 addition & 1 deletion test/test_integration_cluster.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
require_relative "helpers/integration"

class TestIntegrationCluster < TestIntegration
parallelize_me!
parallelize_me! if ::Puma.mri?

def workers ; 2 ; end

Expand Down
2 changes: 1 addition & 1 deletion test/test_integration_pumactl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

class TestIntegrationPumactl < TestIntegration
include TmpPath
parallelize_me!
parallelize_me! if ::Puma.mri?

def workers ; 2 ; end

Expand Down
2 changes: 1 addition & 1 deletion test/test_integration_single.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
require_relative "helpers/integration"

class TestIntegrationSingle < TestIntegration
parallelize_me!
parallelize_me! if ::Puma.mri?

def workers ; 0 ; end

Expand Down
2 changes: 1 addition & 1 deletion test/test_puma_server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require "net/http"

class TestPumaServer < Minitest::Test
parallelize_me!
parallelize_me! unless JRUBY_HEAD

def setup
@host = "127.0.0.1"
Expand Down
10 changes: 6 additions & 4 deletions test/test_puma_server_ssl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@ def test_http_rejection

tcp = Thread.new do
req_http = Net::HTTP::Get.new "/", {}
assert_raises(Errno::ECONNREFUSED, EOFError) do
# Net::ReadTimeout - TruffleRuby
assert_raises(Errno::ECONNREFUSED, EOFError, Net::ReadTimeout) do
http.start.request(req_http) { |rep| body_http = rep.body }
end
end
Expand Down Expand Up @@ -245,7 +246,7 @@ def test_http_rejection

# client-side TLS authentication tests
class TestPumaServerSSLClient < Minitest::Test
parallelize_me!
parallelize_me! unless ::Puma.jruby?

CERT_PATH = File.expand_path "../examples/puma/client-certs", __dir__

Expand Down Expand Up @@ -286,7 +287,8 @@ def assert_ssl_client_error_match(error, subject=nil, &blk)
req = Net::HTTP::Get.new "/", {}
http.request(req)
end
rescue OpenSSL::SSL::SSLError, EOFError
rescue OpenSSL::SSL::SSLError, EOFError, Errno::ECONNRESET
# Errno::ECONNRESET TruffleRuby
client_error = true
# closes socket if open, may not close on error
http.send :do_finish
Expand All @@ -302,7 +304,7 @@ def assert_ssl_client_error_match(error, subject=nil, &blk)
assert_equal subject, events.cert.subject.to_s if subject
end
ensure
server.stop(true)
server.stop(true) if server
end

def test_verify_fail_if_no_client_cert
Expand Down