roachtest: fix WaitForReady bugs#138977
Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom Jan 13, 2025
Merged
Conversation
WaitForReady was not properly handling when the deadline of a timeout context was reached while waiting for the cluster to be ready. Previously, hitting the timeout would result in the roachtest running for 10 minutes until the whole test timed out. Now, WaitForReady respects when the timeutil.RunWithTimeout context times out. Updated WaitForReady's checkReady func to use RoachtestHTTPClient's http client when making the call to GET /health?ready=1 instead of RoachtestHTTPClient's wrapper method. This wrapper method attempts to authenticate the user if no session id exists, but this endpoint doesn't require authentication so it doesnt need to use the wrapper method. Fixes: cockroachdb#138143 Resolves: cockroachdb#136128 Epic: None Release note: None
Member
DarrylWong
reviewed
Jan 13, 2025
Contributor
DarrylWong
left a comment
There was a problem hiding this comment.
The function of DefaultHTTPClient is to add cookies for secure requests. If that's not needed then you can probably just get rid of it and use httputil.Get() directly?
Contributor
Author
The roachtest http client also configures the TLS config: |
Contributor
Yup, you're totally right 🤦 In my defense I only wrote that code so how was I supposed to know? 🙃 |
DarrylWong
approved these changes
Jan 13, 2025
Contributor
Author
|
TFTR! bors r+ |
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
WaitForReady was not properly handling when the deadline of a timeout context was reached while waiting for the cluster to be ready. Previously, hitting the timeout would result in the roachtest running for 10 minutes until the whole test timed out. Now, WaitForReady respects when the timeutil.RunWithTimeout context times out.
Updated WaitForReady's checkReady func to use RoachtestHTTPClient's http client when making the call to GET /health?ready=1 instead of RoachtestHTTPClient's wrapper method. This wrapper method attempts to authenticate the user if no session id exists, but this endpoint doesn't require authentication so it doesnt need to use the wrapper method.
Fixes: #138143
Resolves: #136128
Epic: None
Release note: None