Documentation
¶
Index ¶
- Constants
- func Eventually(t testing.TB, timeout time.Duration, cond func() bool)
- func InstallHermeticStorage() (func(), error)
- func IsLoopbackUnavailable(err error) bool
- func IsolateStorage(t *testing.T) string
- func IsolateStorageIn(t *testing.T, root string)
- func ListenLoopback(t testing.TB) net.Listener
- func Never(t testing.TB, duration time.Duration, cond func() bool)
- func NewLoopbackHTTPServer(t testing.TB, handler http.Handler) *httptest.Server
- func SkipIfLoopbackUnavailable(t testing.TB, err error)
Constants ¶
const ( LoopbackHost = netutil.LoopbackHost LoopbackDynamicAddr = netutil.LoopbackDynamicAddr LoopbackNoProxy = netutil.LoopbackNoProxy )
Variables ¶
This section is empty.
Functions ¶
func Eventually ¶
Eventually polls cond until it returns true or timeout elapses, then fails the test. It replaces fixed time.Sleep calls in asynchronous tests, which are the main source of CI flakiness.
func InstallHermeticStorage ¶
func InstallHermeticStorage() (func(), error)
InstallHermeticStorage gives package-level TestMain functions writable, isolated storage without overriding explicit caller configuration. The returned cleanup restores the environment and removes the temporary root.
func IsLoopbackUnavailable ¶
func IsolateStorage ¶
IsolateStorage configures isolated HOME and Rho config/state/cache dirs for tests.
func IsolateStorageIn ¶
IsolateStorageIn configures isolated HOME and Rho config/state/cache dirs rooted at root.
func Never ¶
Never asserts that cond stays false for the duration, then fails if it ever becomes true. Useful for asserting that a state does not regress.
func NewLoopbackHTTPServer ¶
Types ¶
This section is empty.