Documentation
¶
Index ¶
- func NewStarterClient(t *testing.T, endpoint string) client.API
- func SendIntrAndWait(t *testing.T, starters ...*SubProcess) bool
- func SetUniqueDataDir(t *testing.T) string
- func ShutdownStarter(t *testing.T, endpoint string)
- func WaitUntilStarterGone(t *testing.T, endpoint string)
- func WaitUntilStarterReady(t *testing.T, what string, requiredGoodResults int, starters ...*SubProcess) bool
- type SubProcess
- func (sp *SubProcess) Close() error
- func (sp *SubProcess) ExpectTimeout(ctx context.Context, timeout time.Duration, re *regexp.Regexp, id string) error
- func (sp *SubProcess) Kill() error
- func (sp *SubProcess) SendIntr() error
- func (sp *SubProcess) Start() error
- func (sp *SubProcess) Wait() error
- func (sp *SubProcess) WaitTimeout(timeout time.Duration) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewStarterClient ¶
NewStarterClient creates a new starter API instance for the given endpoint, failing the test on errors.
func SendIntrAndWait ¶
func SendIntrAndWait(t *testing.T, starters ...*SubProcess) bool
SendIntrAndWait stops all all given starter processes by sending a Ctrl-C into it. It then waits until the process has terminated.
func SetUniqueDataDir ¶
SetUniqueDataDir creates a temp dir and sets the DATA_DIR environment variable to it.
func ShutdownStarter ¶
ShutdownStarter calls the starter the shutdown via the HTTP API.
func WaitUntilStarterGone ¶
WaitUntilStarterGone waits until the starter at given endpoint no longer responds to queries.
func WaitUntilStarterReady ¶
func WaitUntilStarterReady(t *testing.T, what string, requiredGoodResults int, starters ...*SubProcess) bool
WaitUntilStarterReady waits until all given starter processes have reached the "Your cluster is ready state"
Types ¶
type SubProcess ¶
type SubProcess struct {
// contains filtered or unexported fields
}
func NewSubProcess ¶
func NewSubProcess(name string, arg ...string) (*SubProcess, error)
NewSubProcess creates a new process with given name and arguments. The process is not yet starter.
func Spawn ¶
func Spawn(t *testing.T, command string) *SubProcess
Spawn a command an return its process and expand envs.
func SpawnWithExpand ¶
func SpawnWithExpand(t *testing.T, command string, expand bool) *SubProcess
Spawn a command an return its process with optionally expanded envs.
func (*SubProcess) ExpectTimeout ¶
func (sp *SubProcess) ExpectTimeout(ctx context.Context, timeout time.Duration, re *regexp.Regexp, id string) error
ExpectTimeout waits for the output of the process to match the given expression, or until a timeout occurs. If a match on the given expression is found, the process output is discard until the end of the match and nil is returned, otherwise a timeout error is returned. If the given context is cancelled, nil is returned.
func (*SubProcess) Kill ¶
func (sp *SubProcess) Kill() error
Kill terminates the process the hard way.
func (*SubProcess) SendIntr ¶
func (sp *SubProcess) SendIntr() error
SendIntr sends a SIGINT to the process.
func (*SubProcess) Wait ¶
func (sp *SubProcess) Wait() error
Wait waits for the process to terminate.
func (*SubProcess) WaitTimeout ¶
func (sp *SubProcess) WaitTimeout(timeout time.Duration) error
WaitTimeout waits for the process to terminate. Kill the process after the given timeout.