Skip to content

Commit

Permalink
Expose parent node name.
Browse files Browse the repository at this point in the history
  • Loading branch information
toregge committed Nov 16, 2024
1 parent 882819f commit 2b8b9e4
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions bin/run-tests-on-swarm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ else
--cap-add SYSLOG --cap-add SYS_PTRACE --cap-add SYS_ADMIN --cap-add SYS_NICE \
${SERVICE_EXTRA_ARGS[@]+"${SERVICE_EXTRA_ARGS[@]}"} \
--name "$SERVICE" --env NODE_SERVER_OPTS="-c $TESTRUNNER.$NETWORK:27183" \
--env 'PARENT_NODE_NAME={{.Node.Hostname}}' \
$ENV_OPTS $BINDMOUNT_OPTS --network "$NETWORK" --detach "$DOCKERIMAGE" &> /dev/null; then
log_error "Could not create service $SERVICE. Exiting."; docker_cleanup; exit 1
fi
Expand Down
2 changes: 2 additions & 0 deletions lib/node_server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,13 @@ class NodeServer
attr_accessor :testcase, :addr_configserver, :hostname, :port_configserver_rpc, :configserver_started
attr_reader :tls_env
attr_reader :https_client
attr_reader :parent_node_name

def initialize(hostname, short_hostname)
@services = [] # must keep list of service objects created to prevent gc
@hostname = hostname
@short_hostname = short_hostname
@parent_node_name = ENV['PARENT_NODE_NAME']
@monitoring = false
@monitor_thread = nil
@http_servers = {}
Expand Down
4 changes: 4 additions & 0 deletions lib/node_server_interface.rb
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,10 @@ def hostname
@node_server.hostname
end

def parent_node_name
@node_server.parent_node_name
end

def port_configserver_rpc
@node_server.port_configserver_rpc
end
Expand Down
4 changes: 4 additions & 0 deletions lib/testcase.rb
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,10 @@ def runmethod(test_method, real_test_method, test_results)
end
output("Timeout length (test_method: " + test_method.to_s + "): " +
timeout_length.to_s)
vespa.nodeproxies.each do |hostname, node|
parent_node_name = node.parent_node_name
output("Host \"#{hostname}\" (parent \"#{parent_node_name}\")")
end
__send__(real_test_method)
end
check_performance(test_method) if performance?
Expand Down

0 comments on commit 2b8b9e4

Please sign in to comment.