testhelper

package
v0.0.6-do.not.use Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2025 License: MIT Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterMetrics

func FilterMetrics(rm metricdata.ResourceMetrics, name string) []metricdata.Metrics

func RandomShortSocketName

func RandomShortSocketName() string

RandomShortSocketName creates a socket name string that avoids common pitfalls in tests. There are a bunch of opposing problems in unit tests with sockets: Ideally, we'd like to use t.TmpDir+something.sock -> too long socket name We can't just use local short file name -> clashes when running tests in parallel We can't use t.ChDir + short name -> t.ChDir does not allow t.Parallel -> we use a short local but randomized socket path

func SetupTelemetry

func SetupTelemetry(t *testing.T) (*tracetest.SpanRecorder, *metric.ManualReader)

func TestLogger

func TestLogger(t *testing.T) logging.Logger

func WaitForClosedWithTimeout

func WaitForClosedWithTimeout(in <-chan struct{}) error

func WaitForErrorWithTimeout

func WaitForErrorWithTimeout(in <-chan error) error

func WaitForWithExplicitTimeoutV

func WaitForWithExplicitTimeoutV[T any](ch <-chan T, timeout time.Duration) (T, error)

func WaitForWithTimeoutV

func WaitForWithTimeoutV[T any](ch <-chan T) (T, error)

Types

type TestTracker

type TestTracker interface {
	telemetry.Tracker
	GetQueue() []any
}

func NewTestTracker

func NewTestTracker() TestTracker

Jump to

Keyboard shortcuts

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