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

Correctly identify Unicorn when used with Rack v3 #1585

Merged
merged 2 commits into from
Nov 2, 2022
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/new_relic/local_environment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ def discover_dispatcher
thin
mongrel
litespeed
unicorn
webrick
fastcgi
rainbows
unicorn
]
# TODO: MAJOR VERSION - remove rainbows
while dispatchers.any? && @discovered_dispatcher.nil?
Expand Down
24 changes: 2 additions & 22 deletions test/multiverse/suites/unicorn/Envfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,13 @@ SUPPORTED_UNICORN_VERSIONS = [
]

def rack_version
if RUBY_VERSION < '2.3.0'
'~> 2.1.4.1'
elsif RUBY_VERSION < '3.0.0'
'~> 2.2.4'
else
# TODO: CI - rack v3.0.0 causes 2 test failures
#
# UnicornTest#test_unicorn_set_as_discovered_dispatcher
# [test/multiverse/suites/unicorn/unicorn_test.rb:32]:
# Didn't see message 'Dispatcher: unicorn'
#
# and
#
# UnicornTest#test_defer_message_logged_when_unicorn_in_use
# [test/multiverse/suites/unicorn/unicorn_test.rb:36]:
# Didn't see message 'Deferring startup of agent reporting thread because unicorn may fork.'
#
# Once the issue is resolved, rack should be set to '~> 3.0.0' below
# '~> 3.0.0'
'~> 2.2.4'
end
RUBY_VERSION >= '2.4' ? '3.0.0' : '2.1.4.1'
end

def gem_list(unicorn_version = nil)
<<-RB
gem 'unicorn'#{unicorn_version}
gem 'rack', "#{rack_version}"
gem 'rack', '~> #{rack_version}'
RB
end

Expand Down