mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-11 21:12:07 +00:00
Merge pull request #121366 from bzsuni/cleanup/test/PollImmediateUntilWithContext
use PollUntilContextCancel to replace PollImmediateUntilWithContext in test
This commit is contained in:
commit
f3c13d8d8a
@ -177,7 +177,7 @@ var _ = utils.SIGDescribe("CSI Mock volume storage capacity", func() {
|
||||
}
|
||||
|
||||
var calls []drivers.MockCSICall
|
||||
err = wait.PollImmediateUntilWithContext(ctx, time.Second, func(ctx context.Context) (done bool, err error) {
|
||||
err = wait.PollUntilContextCancel(ctx, time.Second, true, func(ctx context.Context) (done bool, err error) {
|
||||
c, index, err := compareCSICalls(ctx, deterministicCalls, expected, m.driver.GetCalls)
|
||||
if err != nil {
|
||||
return true, fmt.Errorf("error waiting for expected CSI calls: %w", err)
|
||||
|
@ -283,7 +283,7 @@ func TestPodLogsKubeletClientCertReload(t *testing.T) {
|
||||
}
|
||||
|
||||
// wait until the kubelet observes the new CA
|
||||
if err := wait.PollImmediateUntilWithContext(ctx, time.Second, func(ctx context.Context) (bool, error) {
|
||||
if err := wait.PollUntilContextCancel(ctx, time.Second, true, func(ctx context.Context) (bool, error) {
|
||||
_, errLog := clientSet.CoreV1().Pods("ns").GetLogs(pod.Name, &corev1.PodLogOptions{}).DoRaw(ctx)
|
||||
if errors.IsUnauthorized(errLog) {
|
||||
return true, nil
|
||||
@ -302,7 +302,7 @@ func TestPodLogsKubeletClientCertReload(t *testing.T) {
|
||||
}
|
||||
|
||||
// confirm that the API server observes the new client cert and closes existing connections to use it
|
||||
if err := wait.PollImmediateUntilWithContext(ctx, time.Second, func(ctx context.Context) (bool, error) {
|
||||
if err := wait.PollUntilContextCancel(ctx, time.Second, true, func(ctx context.Context) (bool, error) {
|
||||
fixedPodLogs, errLog := clientSet.CoreV1().Pods("ns").GetLogs(pod.Name, &corev1.PodLogOptions{}).DoRaw(ctx)
|
||||
if errors.IsUnauthorized(errLog) {
|
||||
t.Log("api server has not observed new client cert")
|
||||
|
Loading…
Reference in New Issue
Block a user