Skip to content

Commit

Permalink
fix: fix apply work controller integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhiying Lin committed May 29, 2024
1 parent baeea07 commit dd4f218
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pkg/controllers/work/apply_controller_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,9 @@ var _ = Describe("Work Controller", func() {
})
})

Context("Test multiple work propagation", func() {
// This test will set the work controller to leave and then join again.
// It cannot run parallel with other tests.
Context("Test multiple work propagation", Serial, func() {
var works []*fleetv1beta1.Work

AfterEach(func() {
Expand Down Expand Up @@ -678,7 +680,10 @@ var _ = Describe("Work Controller", func() {
Expect(k8sClient.Get(ctx, types.NamespacedName{Name: works[i].GetName(), Namespace: testWorkNamespace}, &resultWork)).Should(Succeed())
Expect(controllerutil.ContainsFinalizer(&resultWork, fleetv1beta1.WorkFinalizer)).Should(BeFalse())
// make sure that leave can be called as many times as possible
Expect(workController.Leave(ctx)).Should(Succeed())
// The work may be updated and may hit 409 error.
Eventually(func() error {
return workController.Leave(ctx)
}, timeout, interval).Should(Succeed(), "Failed to set the work controller to leave")
By(fmt.Sprintf("change the work = %s", work.GetName()))
cm = &corev1.ConfigMap{
TypeMeta: metav1.TypeMeta{
Expand Down

0 comments on commit dd4f218

Please sign in to comment.