-
Notifications
You must be signed in to change notification settings - Fork 4.8k
OCPEDGE-1788: TNF add etcd cold boot recovery tests from graceful node shutdown #30404
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
Closed
clobrano
wants to merge
6
commits into
openshift:main
from
clobrano:tnf-e2e-cold-boot-from-mixed-gns-ungns
Closed
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
7bd72bf
feat: add VirshShutdownVM helper for graceful VM shutdown
clobrano b6e1384
feat: add three new etcd cold boot recovery tests
clobrano f918765
test: skip etcd recovery tests when cluster is unhealthy
clobrano e5063f4
Enhance initial check implementing a timeout for the etcd pods count
clobrano b02cf1a
Extend recovery timeouts
clobrano 90b1da6
Add skipped tag with known issue reference
clobrano File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if this is the type of comment you're looking for at this point in the life of the PR, but this block seems suspect to me. Available and Degraded are independent, and we are looking for both to be true at the same time to consider the operator healthy. This way of writing the logic seems clearer and also informs on Degraded on the Not Available statuses:
`// Check if etcd operator is healthy (Available and not Degraded)
available := findClusterOperatorCondition(co.Status.Conditions, v1.OperatorAvailable)
degraded := findClusterOperatorCondition(co.Status.Conditions, v1.OperatorDegraded)
if (available != nil && available.Status == v1.ConditionTrue) &&
(degraded == nil || degraded.Status != v1.ConditionTrue) {
framework.Logf("SUCCESS: Cluster operator is healthy")
return nil
}
// Not healthy - report why
var reasons []string
if available == nil {
reasons = append(reasons, "Available condition not found")
} else if available.Status != v1.ConditionTrue {
reasons = append(reasons, fmt.Sprintf("not Available: %s", available.Message))
}
if degraded != nil && degraded.Status == v1.ConditionTrue {
reasons = append(reasons, fmt.Sprintf("Degraded: %s", degraded.Message))
}
return fmt.Errorf("ClusterOperator is unhealthy: %s", strings.Join(reasons, "; "))`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see them independent 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And we return the error message when the
ctxtexpiresThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I've misunderstood the possibilities matrix. Can't the cluster be at the same time Available and Degraded? Doesn't that happen for example if we have 1/2 etcd but kept quorum? (a new cluster where the second member hasn't joined, for example)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We discussed this in chat. I understand the the nested if/else might seem complex to read, but also reading complex boolean conditions might be and might. We agreed to keep the code as is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I agree. We might make it marginally more readable but it's not worth re-doing it when we know it works. The change is not as simple as I though 😓