- Sort Score
- Result 10 results
- Languages All
Results 1 - 6 of 6 for MaxAttempts (0.18 sec)
-
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) -
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) -
staging/src/k8s.io/apimachinery/pkg/util/wait/loop_test.go
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Thu Oct 19 02:48:08 UTC 2023 - 15.8K bytes - Viewed (0) -
pkg/kube/controllers/queue.go
Registered: Fri Jun 14 15:00:06 UTC 2024 - Last Modified: Tue Aug 08 16:43:05 UTC 2023 - 6.3K bytes - Viewed (0) -
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) -
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)