operator: make test more resilient (#1073)

This commit is contained in:
3u13r 2023-01-26 17:52:28 +01:00 committed by GitHub
parent 6c068674af
commit 06b1e04e66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -307,8 +307,12 @@ var _ = Describe("NodeVersion controller", func() {
} }
return firstNode.Annotations return firstNode.Annotations
}, timeout, interval).Should(HaveKeyWithValue(heirAnnotation, secondNodeName)) }, timeout, interval).Should(HaveKeyWithValue(heirAnnotation, secondNodeName))
Expect(k8sClient.Get(ctx, secondNodeLookupKey, secondNode)).Should(Succeed()) Eventually(func() map[string]string {
Expect(secondNode.Annotations).Should(HaveKeyWithValue(donorAnnotation, firstNodeName)) if err := k8sClient.Get(ctx, secondNodeLookupKey, secondNode); err != nil {
return nil
}
return secondNode.Annotations
}, timeout, interval).Should(HaveKeyWithValue(donorAnnotation, firstNodeName))
Eventually(func() error { Eventually(func() error {
if err := k8sClient.Get(ctx, nodeVersionLookupKey, nodeVersion); err != nil { if err := k8sClient.Get(ctx, nodeVersionLookupKey, nodeVersion); err != nil {