Skip to content

Commit

Permalink
Flaky unit test - fails to change DRPC status
Browse files Browse the repository at this point in the history
Signed-off-by: Elena Gershkovich <elenage@il.ibm.com>
  • Loading branch information
ELENAGER authored and raghavendra-talur committed Jun 19, 2023
1 parent 5127005 commit 79607ae
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions controllers/drplacementcontrol_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -735,9 +735,23 @@ func getLatestDRPC() *rmn.DRPlacementControl {
}

func clearDRPCStatus() {
latestDRPC := getLatestDRPC()
latestDRPC.Status = rmn.DRPlacementControlStatus{}
err := k8sClient.Status().Update(context.TODO(), latestDRPC)
localRetries := 0

var err error

for localRetries < updateRetries {
latestDRPC := getLatestDRPC()
latestDRPC.Status = rmn.DRPlacementControlStatus{}

err = k8sClient.Status().Update(context.TODO(), latestDRPC)
if errors.IsConflict(err) {
localRetries++

continue
}

break
}
Expect(err).NotTo(HaveOccurred())
}

Expand Down

0 comments on commit 79607ae

Please sign in to comment.