Skip to content

Commit 985a292

Browse files
committed
Fix a flaky reconcile test when delete
1 parent 6dcb234 commit 985a292

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

pkg/scaffold/controller/controllertest.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,8 @@ func TestReconcile(t *testing.T) {
138138
Should(gomega.Succeed())
139139
140140
// Manually delete Deployment since GC isn't enabled in the test control plane
141-
g.Expect(c.Delete(context.TODO(), deploy)).To(gomega.Succeed())
141+
g.Eventually(func() error { return c.Delete(context.TODO(), deploy) }, timeout).
142+
Should(gomega.MatchError("deployments.apps \"foo-deployment\" not found"))
142143
{{ end }}
143144
}
144145
`

test/project/pkg/controller/firstmate/firstmate_controller_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ func TestReconcile(t *testing.T) {
8282
Should(gomega.Succeed())
8383

8484
// Manually delete Deployment since GC isn't enabled in the test control plane
85-
g.Expect(c.Delete(context.TODO(), deploy)).To(gomega.Succeed())
85+
g.Eventually(func() error { return c.Delete(context.TODO(), deploy) }, timeout).
86+
Should(gomega.MatchError("deployments.apps \"foo-deployment\" not found"))
8687

8788
}

0 commit comments

Comments
 (0)