mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-12 05:21:58 +00:00
use PollUntilContextCancel to replace PollImmediateUntilWithContext in test
Signed-off-by: bzsuni <bingzhe.sun@daocloud.io>
This commit is contained in:
parent
de054fbf94
commit
4a87ee2699
@ -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