-
Notifications
You must be signed in to change notification settings - Fork 191
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
Fix update retry logic in TestConfigurableRoute* #689
Fix update retry logic in TestConfigurableRoute* #689
Conversation
Fix intermittent failures in the TestConfigurableRouteRBAC, TestConfigurableRouteNoSecretNoRBAC, and TestConfigurableRouteNoConsumingUserNoRBAC tests that were caused by incorrect update retry logic. These tests use the eventuallyUpdateIngressSpec and eventuallyUpdateIngressStatus helper functions to update the cluster ingress config. Before this commit, these helper functions attempted to update the ingress config using a polling loop that gets the current config, assigns a value provided as an argument to the helper function to a field in the config value from the API, and then updates the config in the API using the modified config value. The argument value is a complex data type, and so the assignment causes the argument value and the modified config value to reference the same memory. If the update failed, the next iteration of the polling loop would do another get from the API and overwrite the argument value. As a result, the assignment and update in the second and subsequent iterations of the polling loop would use the value from the API, not the value originally provided in the argument. This commit replaces the assignment in the polling loop with a deep copy so that the original argument value is not overwritten by the get. As a result, the test should be more resilient when updates fail. Follow-up to commit baf2d3e. * test/e2e/configurable_route_test.go (eventuallyUpdateIngressSpec) (eventuallyUpdateIngressStatus): Use DeepCopyInto instead of an assignment.
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: candita, Miciah The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/test e2e-aws-operator |
Same Terraform failure. The Terraform issue is being tracked as BZ#2032521. |
Must-gather failed. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/test e2e-upgrade |
Must-gather failed. |
/test e2e-upgrade |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
2 similar comments
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
@Miciah: all tests passed! Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
Fix intermittent failures in the
TestConfigurableRouteRBAC
,TestConfigurableRouteNoSecretNoRBAC
, andTestConfigurableRouteNoConsumingUserNoRBAC
tests that were caused by incorrect update retry logic.These tests use the
eventuallyUpdateIngressSpec
andeventuallyUpdateIngressStatus
helper functions to update the cluster ingress config. Before this change, these helper functions attempted to update the ingress config using a polling loop that gets the current config, assigns a value provided as an argument to the helper function to a field in the config value from the API, and then updates the config in the API using the modified config value. The argument value is a complex data type, and so the assignment causes the argument value and the modified config value to reference the same memory. If the update failed, the next iteration of the polling loop would do another get from the API and overwrite the argument value. As a result, the assignment and update in the second and subsequent iterations of the polling loop would use the value from the API, not the value originally provided in the argument.This change replaces the assignment in the polling loop with a deep copy so that the original argument value is not overwritten by the get. As a result, the test should be more resilient when updates fail.
Follow-up to #552. @awgreene, FYI.
test/e2e/configurable_route_test.go
(eventuallyUpdateIngressSpec
,eventuallyUpdateIngressStatus
): UseDeepCopyInto
instead of an assignment.To reproduce the error, I changed
eventuallyUpdateIngressStatus
to simulate an update failure. I changed the following:...to the following:
That is, after making the assignment to
ingress.Status
, pretend to get an error so the loop starts over with anotherGet
. When I did this, I saw the following:Changing the assignment to a deep copy prevents the failure even when I have the simulated error: