Commit 37aeacff authored by Tiago's avatar Tiago
Browse files

fix regression tests so that the non-resend-request path is enforced

removed some other dead code as well
parent f4a2b58d
Loading
Loading
Loading
Loading
Loading
+5 −2
Changes for regression_tests/bug_1_4_1_test.rb: 5 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@ class Bug_1_4_1_Test < Minitest::Test
      sleep(2)
      response = persistent_session.get(uri)
      verify_status(response, 200)
      assert persistent_session.connections.size == 2, "should have been just 1"
      assert persistent_session.connections.size == 2, "should have been 2 connections"
      assert(persistent_session.connections.one? { |c| c.state == :closed })
    ensure
      persistent_session.close
@@ -54,7 +54,10 @@ class OnPingDisconnectServer < TestHTTP2Server
    def ping_management(*)
      if @num_requests == 1
        @num_requests = 0
        goaway

        # send GOAWAY with unrecoverable code to avoid request resend and make the
        # request be retried on the subsequent connection.
        goaway(:inadequate_security)
      else
        super
      end
+0 −35
Changes for regression_tests/bug_1_4_3_test.rb: 0 added lines, 35 removed lines.
Original line number Diff line number Diff line
@@ -42,38 +42,3 @@ class Bug_1_4_3_Test < Minitest::Test
    end
  end
end

class OnPingDisconnectServer < TestHTTP2Server
  module GoAwayOnFirstPing
    attr_accessor :num_requests

    def activate_stream(*, **)
      super.tap do
        @num_requests += 1
      end
    end

    def ping_management(*)
      if @num_requests == 1
        @num_requests = 0
        goaway
      else
        super
      end
    end
  end

  def initialize(*)
    super
    @num_requests = Hash.new(0)
  end

  private

  def handle_connection(conn, _)
    super

    conn.extend(GoAwayOnFirstPing)
    conn.num_requests = 0
  end
end
+0 −35
Changes for regression_tests/bug_1_5_0_test.rb: 0 added lines, 35 removed lines.
Original line number Diff line number Diff line
@@ -41,38 +41,3 @@ class Bug_1_5_0_Test < Minitest::Test
    end
  end
end

class OnPingDisconnectServer < TestHTTP2Server
  module GoAwayOnFirstPing
    attr_accessor :num_requests

    def activate_stream(*, **)
      super.tap do
        @num_requests += 1
      end
    end

    def ping_management(*)
      if @num_requests == 1
        @num_requests = 0
        goaway
      else
        super
      end
    end
  end

  def initialize(*)
    super
    @num_requests = Hash.new(0)
  end

  private

  def handle_connection(conn, _)
    super

    conn.extend(GoAwayOnFirstPing)
    conn.num_requests = 0
  end
end