@@ -80,15 +80,15 @@ var _ = Describe("Pod webhook", func() {
80
80
81
81
By ("Checking that validation sidecar was created" )
82
82
found := & corev1.Pod {}
83
- Eventually (func () error {
83
+ Eventually (ctx , func (ctx context. Context ) error {
84
84
return k8sClient .Get (ctx , typeNamespaceName , found )
85
- }).Should (Succeed ())
85
+ }, 5 * time . Second ).Should (Succeed ())
86
86
87
- Eventually (
88
- func (_ Gomega ) []corev1.Container {
89
- Expect (k8sClient .Get (ctx , typeNamespaceName , found )).To (Succeed ())
87
+ Eventually (ctx ,
88
+ func (g Gomega , ctx context. Context ) []corev1.Container {
89
+ g . Expect (k8sClient .Get (ctx , typeNamespaceName , found )).To (Succeed ())
90
90
return found .Spec .InitContainers
91
- },
91
+ }, 5 * time . Second ,
92
92
).Should (And (
93
93
WithTransform (func (containers []corev1.Container ) int { return len (containers ) }, Equal (1 )),
94
94
WithTransform (
@@ -112,17 +112,17 @@ var _ = Describe("Pod webhook", func() {
112
112
113
113
By ("Waiting for pod to be injected" )
114
114
found := & corev1.Pod {}
115
- Eventually (func () []corev1.Container {
115
+ Eventually (ctx , func (ctx context. Context ) []corev1.Container {
116
116
_ = k8sClient .Get (ctx , types.NamespacedName {Name : "tracked-pod" , Namespace : Namespace }, found )
117
117
return found .Spec .InitContainers
118
- }).Should (HaveLen (1 ))
118
+ }, 5 * time . Second ).Should (HaveLen (1 ))
119
119
120
120
err = statusTracker .ProcessPodEvent (ctx , found )
121
121
Expect (err ).To (Not (HaveOccurred ()))
122
122
123
123
By ("Checking ModelValidation status was updated" )
124
124
mv := & v1alpha1.ModelValidation {}
125
- Eventually (func () int32 {
125
+ Eventually (ctx , func (ctx context. Context ) int32 {
126
126
_ = k8sClient .Get (ctx , typeNamespaceName , mv )
127
127
return mv .Status .InjectedPodCount
128
128
}, 5 * time .Second ).Should (BeNumerically (">" , 0 ))
0 commit comments