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
APF e2e test: wait for steady state before proceeding #96984
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
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.
Returning an error from this function and letting callers to handle them as they want would be a bit cleaner.
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.
What is meant by "cleaner" here? The suggested change would make the code more complex.
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.
Will make it a bit longer - I don't agree it's more complex.
I actually think that if something can return an error, I want to leave the decision to the called how they handle it, rather the hiding that behavior below.
As an example - the error returned FlowSchemas.Get() - I can easily imagine a caller may want to retry that in some cases. Another example is that I may want to completely differently handle the case of error from API call and differently a timeout from waiting for reconciliation.
Making a decision for the called how they should do that is not the best one.
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 understand that kind of thinking for non-test code. For test code, it seems like unnecessary generality to me --- we do not have an open world of code that will be calling the test code.
I am not sure what complexity measure you are thinking of. I think it is simpler to wrap up things as they are. Returning an error requires duplicating the error-handling at all the call sites, and in this case they all want the same handling. It is only test code; if some day we find the test code wants different error handling in different tests, we can refactor then.
But this is a pretty small detail; I can live with the suggested change.
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 think it's better to change, but it's not something I'm going to fight until death too :)
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.
Another way to do this is to define the checking function, and let the caller invoke via the
framework.ExpectNoError(wait.Poll(...))
line. Given the number and uniformity of the invocations, though, I think that's not necessary yet.We can always change it later, let's leave it for now.