Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 10 for maxAttempts (0.27 sec)

  1. pkg/test/util/retry/retry.go

    func Message(errorMessage string) Option {
    	return func(cfg *config) {
    		cfg.error = errorMessage
    	}
    }
    
    // MaxAttempts allows defining a maximum number of attempts. If unset, only timeout is considered.
    func MaxAttempts(attempts int) Option {
    	return func(cfg *config) {
    		cfg.maxAttempts = attempts
    	}
    }
    
    // RetriableFunc a function that can be retried.
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue Aug 08 16:43:05 UTC 2023
    - 5.6K bytes
    - Viewed (0)
  2. pkg/test/util/retry/retry_test.go

    			t.Fatalf("expected convergence, but test failed: %v", err)
    		}
    	})
    
    	t.Run("attempts fail", func(t *testing.T) {
    		n := 0
    		err := UntilSuccess(func() error {
    			n++
    			return fmt.Errorf("oops")
    		}, MaxAttempts(10), Delay(0))
    		if err == nil {
    			t.Fatalf("expected error")
    		}
    		if n != 10 {
    			t.Fatalf("expected exactly 10 attempts, got %d", n)
    		}
    	})
    
    	t.Run("attempts success", func(t *testing.T) {
    		n := 0
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Jul 20 19:13:32 UTC 2023
    - 2K bytes
    - Viewed (0)
  3. staging/src/k8s.io/apimachinery/pkg/util/wait/loop_test.go

    				attempts++
    				if attempts > maxAttempts {
    					t.Fatalf("should not reach %d attempts", maxAttempts+1)
    				}
    				return attempts >= maxAttempts, nil
    			}); err != nil {
    				t.Fatal(err)
    			}
    			duration := time.Since(start)
    			if min := maxAttempts * intervalMin(test.backoff); duration < min {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Oct 19 02:48:08 UTC 2023
    - 15.8K bytes
    - Viewed (0)
  4. pkg/kube/controllers/queue.go

    type Queue struct {
    	queue       workqueue.RateLimitingInterface
    	initialSync *atomic.Bool
    	name        string
    	maxAttempts int
    	workFn      func(key any) error
    	closed      chan struct{}
    	log         *istiolog.Scope
    }
    
    // WithName sets a name for the queue. This is used for logging
    func WithName(name string) func(q *Queue) {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue Aug 08 16:43:05 UTC 2023
    - 6.3K bytes
    - Viewed (0)
  5. tests/integration/ambient/cacert_rotation_test.go

    			retry.UntilSuccess(func() error {
    				newWorkloadCert := waitForWorkloadCertUpdate(t, ztunnelPod, sa, istioCtl, originalWorkloadSecret)
    				return verifyWorkloadCert(t, newWorkloadCert, newX509)
    			}, retry.MaxAttempts(2), retry.Timeout(5*time.Minute))
    		})
    }
    
    func getWorkloadSecret(t framework.TestContext, zPods []v1.Pod, serviceAccount string, ctl istioctl.Instance) (*configdump.CertsDump, v1.Pod, error) {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue Apr 16 03:28:36 UTC 2024
    - 6.1K bytes
    - Viewed (0)
  6. pkg/test/kube/dump.go

    		var err error
    		fw, err = c.NewPortForwarder(pod.Name, pod.Namespace, "", 0, port)
    		if err != nil {
    			return err
    		}
    		if err = fw.Start(); err != nil {
    			return err
    		}
    		return nil
    	}, retry.MaxAttempts(5), retry.Delay(time.Millisecond*10))
    	return fw, err
    }
    
    var dumpClient = &http.Client{}
    
    func portForwardRequest(fw kube.PortForwarder, method, path string) ([]byte, error) {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Jun 06 22:12:34 UTC 2024
    - 22.2K bytes
    - Viewed (0)
  7. platforms/software/dependency-management/src/main/java/org/gradle/api/internal/artifacts/repositories/transport/NetworkOperationBackOffAndRetry.java

    import org.slf4j.Logger;
    import org.slf4j.LoggerFactory;
    
    import java.util.concurrent.Callable;
    
    
    public class NetworkOperationBackOffAndRetry<T> {
        private final static String MAX_ATTEMPTS = "org.gradle.internal.network.retry.max.attempts";
        private final static String INITIAL_BACKOFF_MS = "org.gradle.internal.network.retry.initial.backOff";
    
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Dec 07 04:09:56 UTC 2023
    - 2.9K bytes
    - Viewed (0)
  8. cluster/gce/gci/health-monitor.sh

      # killing the container runtime.
      until timeout 60 "${healthcheck_command[@]}" > /dev/null; do
        if (( attempt == max_attempts )); then
          echo "Max attempt ${max_attempts} reached! Proceeding to monitor container runtime healthiness."
          break
        fi
        echo "$attempt initial attempt \"${healthcheck_command[*]}\"! Trying again in $attempt seconds..."
        sleep "$(( 2 ** attempt++ ))"
      done
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Jan 20 09:19:08 UTC 2022
    - 3.3K bytes
    - Viewed (0)
  9. cluster/validate-cluster.sh

    # Make several attempts to deal with slow cluster birth.
    return_value=0
    attempt=0
    # Set the timeout to ~25minutes (100 x 15 second) to avoid timeouts for 1000-node clusters.
    PAUSE_BETWEEN_ITERATIONS_SECONDS=15
    MAX_ATTEMPTS=100
    ADDITIONAL_ITERATIONS=$(((CLUSTER_READY_ADDITIONAL_TIME_SECONDS + PAUSE_BETWEEN_ITERATIONS_SECONDS - 1)/PAUSE_BETWEEN_ITERATIONS_SECONDS))
    while true; do
      # Pause between iterations of this large outer loop.
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Oct 01 06:35:39 UTC 2019
    - 7.3K bytes
    - Viewed (0)
  10. cluster/gce/gci/configure.sh

      # Deliberately word split load_image_command
      # shellcheck disable=SC2086
      until timeout 30 ${load_image_command} "${img}"; do
        if [[ "${attempt_num}" == "${max_attempts}" ]]; then
          echo "Fail to load docker image file ${img} using ${load_image_command} after ${max_attempts} retries. Exit!!"
          exit 1
        else
          attempt_num=$((attempt_num+1))
          sleep 5
        fi
      done
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu May 30 04:14:02 UTC 2024
    - 36.5K bytes
    - Viewed (0)
Back to top