respawn

package
Version: v0.0.0-...-130d830 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2021 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package respawn contains shared code to verify that processes respawn after exiting.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TestRespawn

func TestRespawn(ctx context.Context, s *testing.State, name string, f GetPIDFunc) int

TestRespawn kills the process initially returned by f and then verifies that a new process is returned by f. name is a human-readable string describing the process, e.g. "Chrome" or "session_manager". The respawned PID is returned.

func WaitForProc

func WaitForProc(ctx context.Context, f GetPIDFunc, timeout time.Duration, oldPID int) (newPID int, err error)

WaitForProc waits for f to return a process not equal to oldPID. If timeout is positive, it limits the maximum amount of time to wait. The new process's PID is returned.

Types

type GetPIDFunc

type GetPIDFunc func() (int, error)

GetPIDFunc returns a running process's PID. An error should be returned if the process is not found.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto