Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(maint) Acceptance - restructure retry logic for PCP client #338

Merged
merged 1 commit into from
Feb 12, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions acceptance/lib/pxp-agent/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -276,17 +276,17 @@ def rpc_blocking_request(broker, targets,
# @return instance of pcp-client associated with the broker
# @raise exception if could not connect or client is not associated with broker after connecting
def connect_pcp_client(broker)
client = PCP::Client.new({
:server => broker_ws_uri(broker),
:ssl_cert => "../test-resources/ssl/certs/controller01.example.com.pem",
:ssl_key => "../test-resources/ssl/private_keys/controller01.example.com.pem",
:loglevel => logger.is_debug? ? Logger::DEBUG : Logger::WARN
})

client = nil
retries = 0
max_retries = 10
connected = false
until (connected || retries == max_retries) do
client = PCP::Client.new({
:server => broker_ws_uri(broker),
:ssl_cert => "../test-resources/ssl/certs/controller01.example.com.pem",
:ssl_key => "../test-resources/ssl/private_keys/controller01.example.com.pem",
:loglevel => logger.is_debug? ? Logger::DEBUG : Logger::WARN
})
connected = client.connect(5)
retries += 1
end
Expand Down