[CPP tests] Wait for mockZTS to start before connecting to it #15924
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #6298
Motivation
There's a long outstanding flaky CPP test AuthPluginTest.testAthenz which causes CPP builds to fail frequently.
There's a race condition in the test. mockZTS might not be started. Error message is
ERROR [140642816536256] ZTSClient:367 | Response failed for url http://localhost:9999/zts/v1/domain/pulsar.test.provider/token. Error Code 7
.Error Code 7 is
CURLE_COULDNT_CONNECT (7) - Failed to connect() to host or proxy.
in libcurl error codes.Modifications
Wait for mockZTS to start before connecting to it.