helpers

package
v0.3.10 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2020 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteAndCreateFile

func DeleteAndCreateFile(tmpPath string, fileName string) (*os.File, error)

DeleteAndCreateFile checks if the file path given exists, if it does, it deletes it and creates a new file. If not, it just creates the requested file.

func KillProcesses

func KillProcesses(t *testing.T, pIDs []int)

KillProcesses finds the passed in process IDs and kills the process.

func LogErrorOutput

func LogErrorOutput(t *testing.T, file io.Reader, title string, index int)

LogErrorOutput logs the output of a specific file.

func LogOutput

func LogOutput(t *testing.T, config *types.E2EConfig)

LogOutput logs the output of all log files made.

func WaitForTextInFile

func WaitForTextInFile(file *os.File, text string) error

WaitForTextInFile checks a file every polling interval for the text requested.

Types

type EpochTicker

type EpochTicker struct {
	// contains filtered or unexported fields
}

EpochTicker is a special ticker for timing epoch changes. The channel emits over the epoch interval, and ensures that the ticks are in line with the genesis time. This means that the duration between the ticks and the genesis time are always a multiple of the epoch duration. In addition, the channel returns the new epoch number.

func GetEpochTicker

func GetEpochTicker(genesisTime time.Time, secondsPerEpoch uint64) *EpochTicker

GetEpochTicker is the constructor for EpochTicker.

func (*EpochTicker) C

func (s *EpochTicker) C() <-chan uint64

C returns the ticker channel. Call Cancel afterwards to ensure that the goroutine exits cleanly.

func (*EpochTicker) Done

func (s *EpochTicker) Done()

Done should be called to clean up the ticker.

Jump to

Keyboard shortcuts

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