Documentation ¶
Overview ¶
Package helpers defines helper functions to peer into end to end processes and kill processes as needed.
Index ¶
- Variables
- func BeaconAPIHostnames(numConns int) []string
- func ComponentsStarted(ctx context.Context, comps []e2etypes.ComponentRunner) error
- func DeleteAndCreateFile(tmpPath, fileName string) (*os.File, error)
- func DeleteAndCreatePath(fp string) (*os.File, error)
- func EpochTickerStartTime(genesis *eth.Genesis) time.Time
- func FindFollowingTextInFile(file *os.File, text string) (string, error)
- func GraffitiYamlFile(testDir string) (string, error)
- func KeyFromPath(path, pw string) (*keystore.Key, error)
- func LogErrorOutput(t *testing.T, file io.Reader, title string, index int)
- func LogOutput(t *testing.T)
- func MinerRPCClient() (*ethclient.Client, error)
- func NewLocalConnection(ctx context.Context, port int) (*grpc.ClientConn, error)
- func NewLocalConnections(ctx context.Context, numConns int) ([]*grpc.ClientConn, func(), error)
- func WaitForTextInFile(src *os.File, match string) error
- func WaitOnNodes(ctx context.Context, nodes []e2etypes.ComponentRunner, nodesStarted func()) error
- func WritePprofFiles(testDir string, index int) error
- type EpochTicker
Constants ¶
This section is empty.
Variables ¶
var Graffiti = []string{"Sushi", "Ramen", "Takoyaki"}
Graffiti is a list of sample graffiti strings.
Functions ¶
func BeaconAPIHostnames ¶
BeaconAPIHostnames constructs a hostname:port string for the
func ComponentsStarted ¶
func ComponentsStarted(ctx context.Context, comps []e2etypes.ComponentRunner) error
ComponentsStarted checks, sequentially, each provided component, blocks until all of the components are ready.
func DeleteAndCreateFile ¶
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 DeleteAndCreatePath ¶
DeleteAndCreatePath replaces DeleteAndCreateFile where a full path is more convenient than dir,file params.
func EpochTickerStartTime ¶
EpochTickerStartTime calculates the best time to start epoch ticker for a given genesis.
func FindFollowingTextInFile ¶
FindFollowingTextInFile checks a file every polling interval for the following text requested.
func GraffitiYamlFile ¶
GraffitiYamlFile outputs graffiti YAML file into a testing directory.
func KeyFromPath ¶
KeyFromPath should only be used in endtoend tests. It is a simple helper to init a geth keystore.Key from a file.
func LogErrorOutput ¶
LogErrorOutput logs the output of a specific file.
func MinerRPCClient ¶
func NewLocalConnection ¶
NewLocalConnection creates and returns GRPC connection on a given localhost port.
func NewLocalConnections ¶
NewLocalConnections returns number of GRPC connections, along with function to close all of them.
func WaitForTextInFile ¶
WaitForTextInFile checks a file every polling interval for the text requested.
func WaitOnNodes ¶
func WaitOnNodes(ctx context.Context, nodes []e2etypes.ComponentRunner, nodesStarted func()) error
WaitOnNodes waits on nodes to complete execution, accepts function that will be called when all nodes are ready.
func WritePprofFiles ¶
WritePprofFiles writes the memory heap and cpu profile files to the test path.
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 NewEpochTicker ¶
func NewEpochTicker(genesisTime time.Time, secondsPerEpoch uint64) *EpochTicker
NewEpochTicker starts the 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.