Skip to content

Commit

Permalink
Fix flaky test
Browse files Browse the repository at this point in the history
  • Loading branch information
Nuckal777 committed Sep 21, 2023
1 parent c45c321 commit ada0a4b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
- name: Install Ginkgo CLI
run: |
go install github.com/onsi/ginkgo/v2/[email protected].0
go install github.com/onsi/ginkgo/v2/[email protected].1
go install sigs.k8s.io/controller-runtime/tools/[email protected]
- name: Run tests
Expand Down
4 changes: 3 additions & 1 deletion internal/controllers/vpa_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ var _ = Describe("VpaController", func() {
Expect(k8sClient.Get(context.Background(), name, &vpa)).To(Succeed())
unmodified := vpa.DeepCopy()
vpa.Labels = map[string]string{"cloud.sap/reconcile": "please"}
Expect(k8sClient.Patch(context.Background(), &vpa, client.MergeFrom(unmodified))).To(Succeed())
Expect(k8sClient.Patch(context.Background(), &vpa, client.MergeFrom(unmodified))).To(
Satisfy(func(err error) bool { return err == nil || errors.IsNotFound(err) }),
)

Eventually(func(g Gomega) bool {
err := k8sClient.Get(context.Background(), name, &vpa)
Expand Down

0 comments on commit ada0a4b

Please sign in to comment.