Open srm09 opened 1 year ago
Rewriting this assertion https://github.com/vmware-tanzu/tanzu-framework/blame/bd3036ea658d6b7b0fc394ed796c98274b56bdb4/addons/controllers/clusterbootstrap_controller_test.go#L908-L916 might be helpful
// Wait 10 seconds in case reconciliation happens
// time.Sleep(10 * time.Second) <========= Remove this
Eventually(func() bool {
remoteSecret := &corev1.Secret{}
if err := k8sClient.Get(ctx, client.ObjectKey{Namespace: constants.TKGSystemNS, Name: util.GenerateDataValueSecretName(clusterName, foobar1CarvelPackageRefName)}, remoteSecret); err != nil {
return false
}
// values.yaml should not update
if string(s.Data["values.yaml"]) == string(remoteSecret.Data["values.yaml"]) {
return false
}
return true
}, waitTimeout, pollingInterval).Should(BeTrue())// Wait 10 seconds in case reconciliation happens
only to confirm if the above assertion is what the original intention was
Note No need for the timeout since Eventually
will keep retrying until the assertion is met or the timeout occurs whichever is first.
Bug description Seen this test fail multiple times when running the unit tests job
Affected product area (please put an X in all that apply)
Expected behavior