testutil

package
v0.103.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 18, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAvailableLocalAddress

func GetAvailableLocalAddress(t testing.TB) string

GetAvailableLocalAddress finds an available local port on tcp network and returns an endpoint describing it. The port is available for opening when this function returns provided that there is no race by some other code to grab the same port immediately.

func GetAvailableLocalNetworkAddress added in v0.57.2

func GetAvailableLocalNetworkAddress(t testing.TB, network string) string

GetAvailableLocalNetworkAddress finds an available local port on specified network and returns an endpoint describing it. The port is available for opening when this function returns provided that there is no race by some other code to grab the same port immediately.

func GetAvailablePort

func GetAvailablePort(t testing.TB) int

func SetFeatureGateForTest added in v0.55.0

func SetFeatureGateForTest(t testing.TB, gate *featuregate.Gate, enabled bool) func()

Force the state of feature gate for a test usage: defer SetFeatureGateForTest("gateName", true)()

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL