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
Remove flaky test by avoiding reuse of name for replicaset #69739
Conversation
/test pull-kubernetes-integration |
@@ -510,11 +510,12 @@ run_rs_tests() { | |||
# Pre-condition: no replica set exists | |||
kube::test::get_object_assert rs "{{range.items}}{{$id_field}}:{{end}}" '' | |||
# Command | |||
kubectl create -f hack/testdata/frontend-replicaset.yaml "${kube_flags[@]}" | |||
local replicaset_name="frontend-no-cascade" | |||
sed -r 's/^(\s*)(name\s*:\s*frontend\s*$)/\1name: '"${replicaset_name}"'/' hack/testdata/frontend-replicaset.yaml | kubectl create "${kube_flags[@]}" -f - |
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.
Add a todo to revert this after the bug is fixed?
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.
Added todo
53ddf82
to
dcb3d8b
Compare
/test pull-kubernetes-integration |
1 similar comment
/test pull-kubernetes-integration |
/assign @seans3 |
/remove lgtm |
/kind failing-test |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mortent, spiffxp 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 |
When the ReplicaSet controller fetches a fresh version of the ReplicaSet from the server it validates that the UID of the fresh matches the one in the cache. If the UID does not match, a race condition outlined in the issue must have occurred and the controller should intepret the call to syncReplicaSet as a delete. Reverts the merge that temporarily fixed the bug that would occasionally fail as a result of this bug.
What this PR does / why we need it: As reported in #69376, run_rs_tests is flaky and the underlying cause is a problem with ReplicaSets when names are reused. The run_rs_tests actually tests kubectl, so this PR removes the flakiness by avoiding this issue with ReplicaSets. It should fix the flakiness and the issue in ReplicaSet can be fixed separately.
It complicates the test a bit with the use of sed, but it seemed better than using sleep or adding additional test data.
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #69376
Special notes for your reviewer:
@kow3ns
Release note: