File tree Expand file tree Collapse file tree 1 file changed +20
-3
lines changed Expand file tree Collapse file tree 1 file changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -160,13 +160,30 @@ func runTestretryFetchCert(t *testing.T) {
160160
161161 go secretManager .Run (stopCh )
162162 identity := "identity"
163- identity1 := "identity1"
164163 secretManager .SendCertRequest (identity , ADD )
165164 time .Sleep (100 * time .Millisecond )
166165 patches2 .Reset ()
167- secretManager .SendCertRequest (identity1 , RETRY )
166+
167+ secretManager .SendCertRequest (identity , RETRY )
168168 time .Sleep (2000 * time .Millisecond )
169- assert .NotNil (t , secretManager .GetCert (identity ).cert )
169+ for {
170+ cert := secretManager .GetCert (identity )
171+ if cert != nil {
172+ secretManager .certsCache .mu .RLock ()
173+ hasCert := cert .cert != nil
174+ secretManager .certsCache .mu .RUnlock ()
175+ if hasCert {
176+ break
177+ }
178+ }
179+ time .Sleep (100 * time .Millisecond )
180+ }
181+
182+ cert := secretManager .GetCert (identity )
183+ assert .NotNil (t , cert )
184+ secretManager .certsCache .mu .RLock ()
185+ assert .NotNil (t , cert .cert )
186+ secretManager .certsCache .mu .RUnlock ()
170187
171188 close (stopCh )
172189}
You can’t perform that action at this time.
0 commit comments