Deflake "RuntimeClass should reject a Pod requesting a deleted RuntimeClass" test

Test today uses deprecated method PollImmediate, which does not return errors
from context, this commit tries to fix this using instead PollUntilContextTimeout.
This commit is contained in:
Sotiris Salloumis 2024-09-18 17:29:31 +02:00
parent 92507eaabe
commit 197fec8c8a

View File

@ -164,7 +164,7 @@ var _ = SIGDescribe("RuntimeClass", func() {
framework.ExpectNoError(err, "failed to delete RuntimeClass %s", rcName)
ginkgo.By("Waiting for the RuntimeClass to disappear")
framework.ExpectNoError(wait.PollImmediate(framework.Poll, time.Minute, func() (bool, error) {
framework.ExpectNoError(wait.PollUntilContextTimeout(ctx, framework.Poll, time.Minute, true, func(ctx context.Context) (bool, error) {
_, err := rcClient.Get(ctx, rcName, metav1.GetOptions{})
if apierrors.IsNotFound(err) {
return true, nil // done