<commit_before>begin
  require "rack/handler/puma"
rescue LoadError
  false
end

module ActionSystemTest
  module DriverAdapters
    module WebServer # :nodoc:
      def register_server
        Capybara.register_server @server do |app, port, host|
          case @server
          when :puma
            register_puma(app, port)
          when :webrick
            register_webrick(app, port)
          else
            register_default(app, port)
          end
        end
      end

      private
        def register_default(app, port)
          Capybara.run_default_server(app, port)
        end

        def register_puma(app, port)
          Rack::Handler::Puma.run(app, Port: port, Threads: "0:4")
        end

        def register_webrick(app, port)
          Rack::Handler::WEBrick.run(app, Port: port, AccessLog: [], Logger: WEBrick::Log::new(nil, 0))
        end

        def set_server
          Capybara.server = @server
        end

        def set_port
          Capybara.server_port = @port
        end
    end
  end
end<commit_msg>Use 1 thread instead of 4 with Puma server for system tests<commit_after>begin
  require "rack/handler/puma"
rescue LoadError
  false
end

module ActionSystemTest
  module DriverAdapters
    module WebServer # :nodoc:
      def register_server
        Capybara.register_server @server do |app, port, host|
          case @server
          when :puma
            register_puma(app, port)
          when :webrick
            register_webrick(app, port)
          else
            register_default(app, port)
          end
        end
      end

      private
        def register_default(app, port)
          Capybara.run_default_server(app, port)
        end

        def register_puma(app, port)
          Rack::Handler::Puma.run(app, Port: port, Threads: "0:1")
        end

        def register_webrick(app, port)
          Rack::Handler::WEBrick.run(app, Port: port, AccessLog: [], Logger: WEBrick::Log::new(nil, 0))
        end

        def set_server
          Capybara.server = @server
        end

        def set_port
          Capybara.server_port = @port
        end
    end
  end
end
{'fraction_non_alphanumeric': 0.07749766573295985, 'fraction_numerical': 0.003734827264239029, 'mean_word_length': 1.9196185286103542, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2654215', 'n_tokens_mistral': 661, 'n_tokens_neox': 636, 'n_words': 166}