wctest

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Configuration

func Configuration() *conf.Configuration

Configuration returns a testdata configuration for test.

func InitBuffWriteSyncer

func InitBuffWriteSyncer(opts ...zap.Option) *logtest.Buffer

InitBuffWriteSyncer returns a Memory WriteSyncer for log test

func InitGlobalLogger

func InitGlobalLogger(disableStacktrace bool)

InitGlobalLogger sets a sample logger as the global logger for pkg log test.

func RunWait

func RunWait(log func(args ...any), timeout time.Duration, fns ...func() error) error

RunWait runs some long time task functions for given duration to start, and the tasks keep running after timeout. log is a function to log error message.

func RunWaitDone added in v0.5.0

func RunWaitDone(timeout time.Duration, fns ...func() error) error

RunWaitDone runs the given functions thought goroutine and waits for a time. If all tasks done, return nil error. if task return error,Run will return context.Canceled error immediately. you should handle the error in the task.

Types

This section is empty.

Jump to

Keyboard shortcuts

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