Skip to content

Commit

Permalink
Fix tests for JRuby
Browse files Browse the repository at this point in the history
Well, "fix" might overstate it, but we were able to get them passing
by backporting test skips that are currently in Puma master upstream.

With these skips, not only does tag `4.3.3.` all pass, but so does
our custom branch, so we can be pretty confident we haven't broken
anything vs. stock Puma.

Some notes on test runs:
- Invoke with `bundle exec rake test --trace`
- Ctrl-C'ing the tests usually left a zombified version running in the
background, which would *cause failures on subsequent runs*.  Ensure
after killing the a test run that no test processes remain in `jps -lm`
- `TestThreadPool` tests are flaky in this release, though this was a
known issue, and has been recently fixed here: puma#2220
  • Loading branch information
dmarcotte committed Apr 23, 2020
1 parent 075f913 commit 7f67b1c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/test_cli.rb
Expand Up @@ -66,6 +66,7 @@ def test_control_for_tcp
end

def test_control_for_ssl
skip_on :jruby # backported from https://github.com/puma/puma/blob/b0b17f6ffd6a3fc858202a2b0ac1385f45603b18/test/test_cli.rb#L67
app_port = UniquePort.call
control_port = UniquePort.call
control_host = "127.0.0.1"
Expand Down Expand Up @@ -97,8 +98,8 @@ def test_control_for_ssl
assert_match(expected_stats, Puma.stats)

ensure
cli.launcher.stop
t.join
cli.launcher.stop if cli
t.join if t
end

def test_control_clustered
Expand Down
2 changes: 2 additions & 0 deletions test/test_launcher.rb
Expand Up @@ -5,6 +5,7 @@
class TestLauncher < Minitest::Test
def test_dependencies_and_files_to_require_after_prune_is_correctly_built_for_no_extra_deps
skip_on :no_bundler
skip_on :jruby, suffix: " - customizing puma.gemspec to disable the C native extension invalidates this test"

deps, dirs = launcher.send(:dependencies_and_files_to_require_after_prune)

Expand All @@ -17,6 +18,7 @@ def test_dependencies_and_files_to_require_after_prune_is_correctly_built_for_no
end

def test_dependencies_and_files_to_require_after_prune_is_correctly_built_with_extra_deps
skip_on :jruby, suffix: " - customizing puma.gemspec to disable the C native extension invalidates this test"
skip_on :no_bundler
conf = Puma::Configuration.new do |c|
c.extra_runtime_dependencies ['rdoc']
Expand Down
1 change: 1 addition & 0 deletions test/test_pumactl.rb
Expand Up @@ -149,6 +149,7 @@ def test_control_url_and_status
end

def test_control_ssl
skip_on :jruby # ported from https://github.com/puma/puma/blob/4ef001000e71f987ccfacd28c3cbda614d3717ff/test/test_pumactl.rb#L144
host = "127.0.0.1"
port = find_open_port
url = "ssl://#{host}:#{port}?#{ssl_query}"
Expand Down

0 comments on commit 7f67b1c

Please sign in to comment.