From 7da7162e44897d286c48bba027fc4ce4e5bac913 Mon Sep 17 00:00:00 2001 From: Camden Narzt Date: Mon, 19 Aug 2024 17:19:22 -0600 Subject: [PATCH] fix port choice --- dev/ci/lib/set-container-envvars.sh | 2 +- test/support/nginx_controller.rb | 10 +++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/dev/ci/lib/set-container-envvars.sh b/dev/ci/lib/set-container-envvars.sh index face681048..046cb65a38 100644 --- a/dev/ci/lib/set-container-envvars.sh +++ b/dev/ci/lib/set-container-envvars.sh @@ -24,7 +24,7 @@ export CCACHE_LOGFILE="$(pwd)/buildout/testlogs/ccache.log" export NOEXEC_DISABLE=1 if [[ "$EXECUTOR_NUMBER" != "" ]]; then - (( TEST_PORT_BASE=64000+EXECUTOR_NUMBER*10 )) + (( TEST_PORT_BASE=64000 )) export TEST_PORT_BASE fi diff --git a/test/support/nginx_controller.rb b/test/support/nginx_controller.rb index c99332faf3..e016374ffa 100644 --- a/test/support/nginx_controller.rb +++ b/test/support/nginx_controller.rb @@ -7,6 +7,8 @@ class NginxController TEMPLATE_DIR = File.expand_path(File.dirname(__FILE__) + "/../stub/nginx") PORT = ENV.fetch('TEST_PORT_BASE', '64507').to_i + PORT = 64507 if PORT > 64507 + def initialize(root_dir, log_file) root_dir = File.expand_path(root_dir) @passenger_root = PhusionPassenger.install_spec @@ -44,13 +46,7 @@ def stop @controller.stop # On OS X, the Nginx server socket may linger around for a while # after Nginx shutdown, despite Nginx setting SO_REUSEADDR. - begin - sockaddr = Socket.pack_sockaddr_in(PORT, '127.0.0.1') - rescue SocketError => e - p port - p e - raise e - end + sockaddr = Socket.pack_sockaddr_in(PORT, '127.0.0.1') eventually(30) do !@controller.send(:ping_socket, Socket::Constants::AF_INET, sockaddr) end