From 46543a75ac9a81147596f246b6a6f83c2b94e73f Mon Sep 17 00:00:00 2001 From: Matej Vasek Date: Wed, 18 Oct 2023 15:53:06 +0200 Subject: [PATCH] fix: replace deprecated function Signed-off-by: Matej Vasek --- test/common/readycheck.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/common/readycheck.go b/test/common/readycheck.go index 4b4c4ab691..a1801429bc 100644 --- a/test/common/readycheck.go +++ b/test/common/readycheck.go @@ -1,6 +1,7 @@ package common import ( + "context" "testing" "time" @@ -8,7 +9,7 @@ import ( ) func WaitForFunctionReady(t *testing.T, functionName string) (revisionName string, functionUrl string) { - err := wait.PollImmediate(5*time.Second, 1*time.Minute, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.Background(), 5*time.Second, 1*time.Minute, true, func(_ context.Context) (done bool, err error) { revisionName, functionUrl = GetKnativeServiceRevisionAndUrl(t, functionName) t.Logf("Waiting function to get ready (revision [%v])", revisionName) return revisionName != "", nil @@ -21,7 +22,7 @@ func WaitForFunctionReady(t *testing.T, functionName string) (revisionName strin // NewRevisionCheck waits for a new revision to report as ready func WaitForNewRevisionReady(t *testing.T, previousRevision string, functionName string) (newRevision string) { - err := wait.PollImmediate(5*time.Second, 1*time.Minute, func() (done bool, err error) { + err := wait.PollUntilContextTimeout(context.Background(), 5*time.Second, 1*time.Minute, true, func(_ context.Context) (done bool, err error) { newRevision = GetCurrentServiceRevision(t, functionName) t.Logf("Waiting for new revision deployment (previous revision [%v], current revision [%v])", previousRevision, newRevision) return newRevision != "" && newRevision != previousRevision, nil