Skip to content

Commit

Permalink
fix port choice
Browse files Browse the repository at this point in the history
  • Loading branch information
CamJN committed Aug 19, 2024
1 parent bf1beff commit 7da7162
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion dev/ci/lib/set-container-envvars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
10 changes: 3 additions & 7 deletions test/support/nginx_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 7da7162

Please sign in to comment.