Unit tests periodically failing: `the object has been modified; please apply your changes to the latest version and try again`
Summary
Example failure: https://gitlab.com/gitlab-org/cloud-native/gitlab-operator/-/jobs/3133982302
GitLab controller GitLab CR spec [It] Should change the managed resources when the Chart values change
/builds/gitlab-org/cloud-native/gitlab-operator/controllers/gitlab_controller_test.go:58
Expected success, but got an error:
<*errors.StatusError | 0xc002b88820>: {
ErrStatus: {
TypeMeta: {Kind: "", APIVersion: ""},
ListMeta: {
SelfLink: "",
ResourceVersion: "",
Continue: "",
RemainingItemCount: nil,
},
Status: "Failure",
Message: "Operation cannot be fulfilled on gitlabs.apps.gitlab.com \"cr-spec-changes\": the object has been modified; please apply your changes to the latest version and try again",
Reason: "Conflict",
Details: {
Name: "cr-spec-changes",
Group: "apps.gitlab.com",
Kind: "gitlabs",
UID: "",
Causes: nil,
RetryAfterSeconds: 0,
},
Code: 409,
},
}
Operation cannot be fulfilled on gitlabs.apps.gitlab.com "cr-spec-changes": the object has been modified; please apply your changes to the latest version and try again
/builds/gitlab-org/cloud-native/gitlab-operator/controllers/suite_helpers_test.go:180