Skip to content

Commit

Permalink
test: fix flaky ValidatorConfig test
Browse files Browse the repository at this point in the history
Signed-off-by: Tyler Gillson <tyler.gillson@gmail.com>
  • Loading branch information
TylerGillson committed Nov 16, 2023
1 parent e2e98e7 commit 7146c9a
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions internal/controller/validatorconfig_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,19 @@ var _ = Describe("ValidatorConfig controller", Ordered, func() {
By("Updating the ValidatorConfig")
ctx := context.Background()

Expect(k8sClient.Get(ctx, vcKey, vc)).Should(Succeed())

vc.Spec.Plugins[0].Chart.Version = networkPluginVersionPost
vc.Spec.Plugins[0].Values = strings.ReplaceAll(
vc.Spec.Plugins[0].Values, networkPluginVersionPre, networkPluginVersionPost,
)

Expect(k8sClient.Update(ctx, vc)).Should(Succeed())
Eventually(func() bool {
if err := k8sClient.Get(ctx, vcKey, vc); err != nil {
return false
}
vc.Spec.Plugins[0].Chart.Version = networkPluginVersionPost
vc.Spec.Plugins[0].Values = strings.ReplaceAll(
vc.Spec.Plugins[0].Values, networkPluginVersionPre, networkPluginVersionPost,
)
if err := k8sClient.Update(ctx, vc); err != nil {
return false
}
return true
}, timeout, interval).Should(BeTrue(), "failed to update validator-plugin-network")

// Wait for the validator-plugin-network Deployment to be upgraded
Eventually(func() bool {
Expand Down

0 comments on commit 7146c9a

Please sign in to comment.