Skip to content

Commit

Permalink
add retry for source client in serverside apply e2e test. (#208)
Browse files Browse the repository at this point in the history
Signed-off-by: morvencao <[email protected]>
  • Loading branch information
morvencao authored Oct 28, 2024
1 parent 3c09e09 commit 1de63c6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/e2e/pkg/serverside_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,10 @@ var _ = Describe("Server Side Apply", Ordered, Label("e2e-tests-serverside-apply
nestedWorkNamespace := "default"

work := NewNestedManifestWork(nestedWorkNamespace, workName, nestedWorkName)
_, err := sourceWorkClient.ManifestWorks(agentTestOpts.consumerName).Create(ctx, work, metav1.CreateOptions{})
Expect(err).ShouldNot(HaveOccurred())
Eventually(func() error {
_, err := sourceWorkClient.ManifestWorks(agentTestOpts.consumerName).Create(ctx, work, metav1.CreateOptions{})
return err
}, 5*time.Minute, 5*time.Second).ShouldNot(HaveOccurred())

// make sure the nested work is created
Eventually(func() error {
Expand All @@ -148,7 +150,7 @@ var _ = Describe("Server Side Apply", Ordered, Label("e2e-tests-serverside-apply
return nil
}, 1*time.Minute, 1*time.Second).Should(BeNil())

err = sourceWorkClient.ManifestWorks(agentTestOpts.consumerName).Delete(ctx, workName, metav1.DeleteOptions{})
err := sourceWorkClient.ManifestWorks(agentTestOpts.consumerName).Delete(ctx, workName, metav1.DeleteOptions{})
Expect(err).ShouldNot(HaveOccurred())
})
})
Expand Down

0 comments on commit 1de63c6

Please sign in to comment.