istio: istio.io/istio/pkg/test Index | Files | Directories

package test

import "istio.io/istio/pkg/test"

Index

Package Files

eventually.go failer.go

func Eventually Uses

func Eventually(t Failer, name string, cond Condition)

Eventually polls cond until it completes (returns true) or times out (resulting in a test failure).

type Condition Uses

type Condition func() bool

A Condition is a function that returns true when a test condition is satisfied.

type EventualOpts Uses

type EventualOpts struct {
    // contains filtered or unexported fields
}

EventualOpts defines a polling strategy for operations that must eventually succeed. A new EventualOpts must be provided for each invocation of Eventually (or call Reset on a previously completed set of options).

func NewEventualOpts Uses

func NewEventualOpts(interval, deadline time.Duration) *EventualOpts

NewEventualOpts constructs an EventualOpts instance with the provided polling interval and deadline. EventualOpts will perform randomized exponential backoff using the starting interval, and will stop polling (and therefore fail) after deadline time as elapsed from calling Eventually.

Note: we always backoff with a randomization of 0.5 (50%), a multiplier of 1.5, and a max interval of one minute.

func (EventualOpts) Eventually Uses

func (e EventualOpts) Eventually(t Failer, name string, cond Condition)

Eventually polls cond until it succeeds (returns true) or we exceed the deadline. Eventually performs backoff while polling cond.

name is printed as part of the test failure message when we exceed the deadline to help identify the test case failing. cond does not need to be thread-safe: it is only called from the current goroutine. cond itself can also fail the test early using t.Fatal.

type Failer Uses

type Failer interface {
    Fail()
    FailNow()
    Fatal(args ...interface{})
    Fatalf(format string, args ...interface{})
    Helper()
}

Failer is an interface to be provided to test functions of the form XXXOrFail. This is a substitute for testing.TB, which cannot be implemented outside of the testing package.

Directories

PathSynopsis
configPackage test is a generated protocol buffer package.
conformance
conformance/constraint
deployment
deps
docker
docker/registry
docker/registry/cmd
echo/client
echo/common
echo/common/response
echo/common/scheme
echo/proto
echo/server
echo/server/endpoint
echo/server/forwarder
env
envoy
fakes/policy
framework
framework/components/bookinfo
framework/components/citadel
framework/components/deployment
framework/components/echo
framework/components/echo/common
framework/components/echo/docker
framework/components/echo/docker/images
framework/components/echo/echoboot
framework/components/echo/kube
framework/components/environment
framework/components/environment/api
framework/components/environment/kube
framework/components/environment/native
framework/components/galley
framework/components/ingress
framework/components/istio
framework/components/istioctl
framework/components/mcpserver
framework/components/mixer
framework/components/namespace
framework/components/pilot
framework/components/policybackend
framework/components/prometheus
framework/components/redis
framework/components/zipkin
framework/core
framework/core/image
framework/integration
framework/label
framework/resource
helm
kube
scopes
shell
util
util/crosscompile
util/file
util/reserveport
util/retry
util/structpath
util/tmpl
util/yml

Package test imports 3 packages (graph) and is imported by 31 packages. Updated 2019-10-19. Refresh now. Tools for package owners.