Replace usages of deprecated funcs from the wait pkg

This commit is contained in:
Ryan Richard
2023-05-10 11:41:11 -07:00
parent 4756df08cb
commit a1a99b9eeb
3 changed files with 14 additions and 9 deletions
@@ -486,7 +486,7 @@ func TestController(t *testing.T) {
authenticated bool
err error
)
_ = wait.PollImmediate(10*time.Millisecond, 5*time.Second, func() (bool, error) {
_ = wait.PollUntilContextTimeout(context.Background(), 10*time.Millisecond, 5*time.Second, true, func(ctx context.Context) (bool, error) {
rsp, authenticated, err = cachedAuthenticator.AuthenticateToken(context.Background(), jwt)
return !isNotInitialized(err), nil
})
+2 -1
View File
@@ -4,6 +4,7 @@
package dynamiccert
import (
"context"
"crypto/tls"
"crypto/x509"
"net"
@@ -194,7 +195,7 @@ func TestProviderWithDynamicServingCertificateController(t *testing.T) {
var lastTLSConfig *tls.Config
// it will take some time for the controller to catch up
err = wait.PollImmediate(time.Second, 30*time.Second, func() (bool, error) {
err = wait.PollUntilContextTimeout(context.Background(), time.Second, 30*time.Second, true, func(ctx context.Context) (bool, error) {
actualTLSConfig, err := tlsConfig.GetConfigForClient(&tls.ClientHelloInfo{ServerName: "force-standard-sni"})
if err != nil {
return false, err