Skip to content

Commit

Permalink
Remove unused attr_writer (#2955)
Browse files Browse the repository at this point in the history
* Remove unused attr_writer

* Configure some options to fix tests

Co-authored-by: MSP-Greg <Greg.mpls@gmail.com>

Co-authored-by: MSP-Greg <Greg.mpls@gmail.com>
  • Loading branch information
cafedomancer and MSP-Greg committed Sep 15, 2022
1 parent 0a57ffd commit 2039e61
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 14 deletions.
5 changes: 0 additions & 5 deletions lib/puma/server.rb
Expand Up @@ -46,11 +46,6 @@ class Server
:leak_stack_on_error,
:persistent_timeout, :reaping_time

# @deprecated v6.0.0
attr_writer :auto_trim_time, :early_hints, :first_data_timeout,
:leak_stack_on_error, :min_threads, :max_threads,
:persistent_timeout, :reaping_time

attr_accessor :app
attr_accessor :binder

Expand Down
5 changes: 3 additions & 2 deletions test/test_integration_ssl.rb
@@ -1,5 +1,6 @@
require_relative 'helper'
require_relative "helpers/integration"
require "puma/log_writer"

# These tests are used to verify that Puma works with SSL sockets. Only
# integration tests isolate the server from the test environment, so there
Expand Down Expand Up @@ -97,8 +98,8 @@ def test_ssl_run_with_curl_client
skip_if :windows; require 'stringio'

app = lambda { |_| [200, { 'Content-Type' => 'text/plain' }, ["HELLO", ' ', "THERE"]] }
server = Puma::Server.new(app)
server.max_threads = 1
opts = {max_threads: 1}
server = Puma::Server.new app, Puma::LogWriter.stdio, Puma::Events.new, opts
if Puma.jruby?
ssl_params = {
'keystore' => File.expand_path('../examples/puma/client-certs/keystore.jks', __dir__),
Expand Down
11 changes: 6 additions & 5 deletions test/test_persistent.rb
@@ -1,4 +1,5 @@
require_relative "helper"
require "puma/log_writer"

class TestPersistent < Minitest::Test

Expand All @@ -23,9 +24,9 @@ def setup
[status, @headers, @body]
end

@server = Puma::Server.new @simple
opts = {max_threads: 1}
@server = Puma::Server.new @simple, Puma::LogWriter.stdio, Puma::Events.new, opts
@port = (@server.add_tcp_listener HOST, 0).addr[1]
@server.max_threads = 1
@server.run
sleep 0.15 if Puma.jruby?
@client = TCPSocket.new HOST, @port
Expand Down Expand Up @@ -156,7 +157,7 @@ def test_one_with_keep_alive_header
end

def test_persistent_timeout
@server.persistent_timeout = 1
@server.instance_variable_set(:@persistent_timeout, 1)
@client << @valid_request
sz = @body[0].size.to_s

Expand Down Expand Up @@ -193,7 +194,7 @@ def test_allow_app_to_chunk_itself


def test_two_requests_in_one_chunk
@server.persistent_timeout = 3
@server.instance_variable_set(:@persistent_timeout, 3)

req = @valid_request.to_s
req += "GET /second HTTP/1.1\r\nHost: test.com\r\nContent-Type: text/plain\r\n\r\n"
Expand All @@ -210,7 +211,7 @@ def test_two_requests_in_one_chunk
end

def test_second_request_not_in_first_req_body
@server.persistent_timeout = 3
@server.instance_variable_set(:@persistent_timeout, 3)

req = @valid_request.to_s
req += "GET /second HTTP/1.1\r\nHost: test.com\r\nContent-Type: text/plain\r\n\r\n"
Expand Down
2 changes: 1 addition & 1 deletion test/test_puma_server.rb
Expand Up @@ -529,7 +529,7 @@ def test_timeout_data_no_queue

# https://github.com/puma/puma/issues/2574
def test_no_timeout_after_data_received
@server.first_data_timeout = 1
@server.instance_variable_set(:@first_data_timeout, 1)
server_run

sock = send_http "POST / HTTP/1.1\r\nHost: test.com\r\nContent-Type: text/plain\r\nContent-Length: 11\r\n\r\n"
Expand Down
2 changes: 1 addition & 1 deletion test/test_response_header.rb
Expand Up @@ -28,7 +28,7 @@ def teardown
def server_run(app: @app, early_hints: false)
@server.app = app
@port = (@server.add_tcp_listener @host, 0).addr[1]
@server.early_hints = true if early_hints
@server.instance_variable_set(:@early_hints, true) if early_hints
@server.run
end

Expand Down

0 comments on commit 2039e61

Please sign in to comment.