Skip to content

Commit 20296e5

Browse files
committed
operator: fix flaky role_controller unit test (#92)
1 parent 54b90ef commit 20296e5

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
2020
- Not working update of replicaset roles
2121
- Not working update of container env vars
2222
- Problem with a non-existent leader of cluster
23+
- Flaky role_controller unit test
2324

2425
## [0.0.8] - 2020-12-16
2526

pkg/controller/role/role_test.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,14 @@ var _ = Describe("role_controller unit testing", func() {
9595
sts := &appsv1.StatefulSet{}
9696
Eventually(
9797
func() bool {
98-
return k8sClient.Get(ctx, client.ObjectKey{Name: stsName, Namespace: namespace}, sts) == nil
98+
if k8sClient.Get(ctx, client.ObjectKey{Name: stsName, Namespace: namespace}, sts) != nil {
99+
return false
100+
}
101+
if sts.ObjectMeta.Annotations["tarantool.io/rolesToAssign"] == "" ||
102+
sts.Spec.Template.Annotations["tarantool.io/rolesToAssign"] == "" {
103+
return false
104+
}
105+
return true
99106
},
100107
time.Second*10, time.Millisecond*500,
101108
).Should(BeTrue())

0 commit comments

Comments
 (0)