예제 #1
0
func (e *FailLaterExecutor) Execute(opts exec.ExecuteOptions) error {
	defer e.calls.Increment()
	var err error
	fail := e.Succeeds <= e.calls.Val()
	if fail {
		opts.Stdout = opts.Stderr
		err = errors.New("")
	}
	e.FakeExecutor.Execute(opts)
	return err
}
예제 #2
0
func (e *RetryExecutor) Execute(opts exec.ExecuteOptions) error {
	defer e.calls.Increment()
	var err error
	succeed := e.Failures <= e.calls.Val()
	if !succeed {
		opts.Stdout = opts.Stderr
		err = errors.New("")
	}
	e.FakeExecutor.Execute(opts)
	return err
}