lib/percy/network_helpers.rb in percy-common-3.1.8 vs lib/percy/network_helpers.rb in percy-common-3.1.9

- old
+ new

@@ -8,12 +8,12 @@ MAX_PORT_ATTEMPTS = 50 class ServerDown < RuntimeError; end class OpenPortNotFound < RuntimeError; end - def self.random_open_port + def self.random_open_port(min_port: MIN_PORT, max_port: MAX_PORT) MAX_PORT_ATTEMPTS.times do - port = rand(MIN_PORT..MAX_PORT) + port = rand(min_port..max_port) return port if port_open? port end raise OpenPortNotFound end