testutil

package
v3.29.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChannelEmpty

func ChannelEmpty[T any](t *testing.T, inCh <-chan T, timeout time.Duration)

ChannelEmpty asserts that a channel is empty and does not receive any message, giving a timeout as margin to check that no actual messages are received during that Duration.

func FreeTCPPort added in v3.28.0

func FreeTCPPort(t *testing.T) int

FreeTCPPort returns a free TCP port that can be used for testing.

func ReadChannel

func ReadChannel[T any](t *testing.T, inCh <-chan T, timeout time.Duration) T

ReadChannel tries to read a message from a channel and returns it. If there isn't any message after the given timeout, it fails the provided test

Types

This section is empty.

Jump to

Keyboard shortcuts

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