mirror of
https://github.com/puma/puma.git
synced 2022-11-09 13:48:40 -05:00
Improve reliability of non-MRI CI
Jobs still occasionally freeze/time-out in test step. 1. Allows jruby-head to fail (as done previously) 2. Actions - change all Ubuntu JRuby OS's to 20.04 (18.04 uses JDK-8, 20.04 uses JDK-11) 3. Integration tests (cluster, pumactl, single) - only run parallel on MRI Rubies 4. `helper.rb` - `TestSkips` - add `JRUBY_HEAD` constant for use with non-parallel conditionals and skips 5. `test_puma_server.rb` - jruby-head - run non-parallel 6. `test_puma_server_ssl.rb` - `TestPumaServerSSLClient` tests - non-parallel on JRuby, add `Errno::ECONNRESET` to client net/https rescue for TruffleRuby 7. `test_puma_server_ssl.rb` - `TestPumaServerSSL#test_http_rejection` - add `Net::ReadTimeout` to client net/https rescue for TruffleRuby Update test_puma_server_ssl.rb
This commit is contained in:
parent
54f6911c29
commit
03c3b2f0e1
7 changed files with 15 additions and 14 deletions
9
.github/workflows/non_mri.yml
vendored
9
.github/workflows/non_mri.yml
vendored
|
@ -18,16 +18,13 @@ jobs:
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [ ubuntu-20.04, ubuntu-18.04, macos-10.15 ]
|
os: [ ubuntu-20.04, macos-10.15 ]
|
||||||
ruby: [ jruby, jruby-head, truffleruby-head ]
|
ruby: [ jruby, jruby-head, truffleruby-head ]
|
||||||
no-ssl: ['']
|
no-ssl: ['']
|
||||||
include:
|
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' }
|
- { os: ubuntu-20.04 , ruby: jruby, no-ssl: ' no SSL' }
|
||||||
exclude:
|
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 }
|
- { os: macos-10.15 , ruby: jruby-head }
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
@ -59,7 +56,7 @@ jobs:
|
||||||
|
|
||||||
- name: test
|
- name: test
|
||||||
id: test
|
id: test
|
||||||
timeout-minutes: 20
|
timeout-minutes: 15
|
||||||
continue-on-error: ${{ matrix.allow-failure || false }}
|
continue-on-error: ${{ matrix.allow-failure || false }}
|
||||||
if: success() # only run if previous steps have succeeded
|
if: success() # only run if previous steps have succeeded
|
||||||
run: bundle exec rake test:all
|
run: bundle exec rake test:all
|
||||||
|
|
|
@ -108,6 +108,8 @@ module TestSkips
|
||||||
|
|
||||||
SIGNAL_LIST = Signal.list.keys.map(&:to_sym) - (Puma.windows? ? [:INT, :TERM] : [])
|
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
|
# usage: skip_unless_signal_exist? :USR2
|
||||||
def skip_unless_signal_exist?(sig, bt: caller)
|
def skip_unless_signal_exist?(sig, bt: caller)
|
||||||
signal = sig.to_s.sub(/\ASIG/, '').to_sym
|
signal = sig.to_s.sub(/\ASIG/, '').to_sym
|
||||||
|
|
|
@ -2,7 +2,7 @@ require_relative "helper"
|
||||||
require_relative "helpers/integration"
|
require_relative "helpers/integration"
|
||||||
|
|
||||||
class TestIntegrationCluster < TestIntegration
|
class TestIntegrationCluster < TestIntegration
|
||||||
parallelize_me!
|
parallelize_me! if ::Puma.mri?
|
||||||
|
|
||||||
def workers ; 2 ; end
|
def workers ; 2 ; end
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ require_relative "helpers/integration"
|
||||||
|
|
||||||
class TestIntegrationPumactl < TestIntegration
|
class TestIntegrationPumactl < TestIntegration
|
||||||
include TmpPath
|
include TmpPath
|
||||||
parallelize_me!
|
parallelize_me! if ::Puma.mri?
|
||||||
|
|
||||||
def workers ; 2 ; end
|
def workers ; 2 ; end
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ require_relative "helper"
|
||||||
require_relative "helpers/integration"
|
require_relative "helpers/integration"
|
||||||
|
|
||||||
class TestIntegrationSingle < TestIntegration
|
class TestIntegrationSingle < TestIntegration
|
||||||
parallelize_me!
|
parallelize_me! if ::Puma.mri?
|
||||||
|
|
||||||
def workers ; 0 ; end
|
def workers ; 0 ; end
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ require "puma/events"
|
||||||
require "net/http"
|
require "net/http"
|
||||||
|
|
||||||
class TestPumaServer < Minitest::Test
|
class TestPumaServer < Minitest::Test
|
||||||
parallelize_me!
|
parallelize_me! unless JRUBY_HEAD
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
@host = "127.0.0.1"
|
@host = "127.0.0.1"
|
||||||
|
|
|
@ -216,7 +216,8 @@ class TestPumaServerSSL < Minitest::Test
|
||||||
|
|
||||||
tcp = Thread.new do
|
tcp = Thread.new do
|
||||||
req_http = Net::HTTP::Get.new "/", {}
|
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 }
|
http.start.request(req_http) { |rep| body_http = rep.body }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -245,7 +246,7 @@ end if ::Puma::HAS_SSL
|
||||||
|
|
||||||
# client-side TLS authentication tests
|
# client-side TLS authentication tests
|
||||||
class TestPumaServerSSLClient < Minitest::Test
|
class TestPumaServerSSLClient < Minitest::Test
|
||||||
parallelize_me!
|
parallelize_me! unless ::Puma.jruby?
|
||||||
|
|
||||||
CERT_PATH = File.expand_path "../examples/puma/client-certs", __dir__
|
CERT_PATH = File.expand_path "../examples/puma/client-certs", __dir__
|
||||||
|
|
||||||
|
@ -286,7 +287,8 @@ class TestPumaServerSSLClient < Minitest::Test
|
||||||
req = Net::HTTP::Get.new "/", {}
|
req = Net::HTTP::Get.new "/", {}
|
||||||
http.request(req)
|
http.request(req)
|
||||||
end
|
end
|
||||||
rescue OpenSSL::SSL::SSLError, EOFError
|
rescue OpenSSL::SSL::SSLError, EOFError, Errno::ECONNRESET
|
||||||
|
# Errno::ECONNRESET TruffleRuby
|
||||||
client_error = true
|
client_error = true
|
||||||
# closes socket if open, may not close on error
|
# closes socket if open, may not close on error
|
||||||
http.send :do_finish
|
http.send :do_finish
|
||||||
|
@ -302,7 +304,7 @@ class TestPumaServerSSLClient < Minitest::Test
|
||||||
assert_equal subject, events.cert.subject.to_s if subject
|
assert_equal subject, events.cert.subject.to_s if subject
|
||||||
end
|
end
|
||||||
ensure
|
ensure
|
||||||
server.stop(true)
|
server.stop(true) if server
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_verify_fail_if_no_client_cert
|
def test_verify_fail_if_no_client_cert
|
||||||
|
|
Loading…
Reference in a new issue