diff --git a/test/e2e/runner/load.go b/test/e2e/runner/load.go index b16df5ed2..23050c636 100644 --- a/test/e2e/runner/load.go +++ b/test/e2e/runner/load.go @@ -54,9 +54,25 @@ func Load(ctx context.Context, testnet *e2e.Testnet) error { case numSeen := <-chSuccess: success += numSeen case <-ctx.Done(): - if success == 0 { + // if we couldn't submit any transactions, + // that's probably a problem and the test + // should error; however, for very short tests + // we shouldn't abort. + // + // The 2s cut off, is a rough guess based on + // the expected value of + // loadGenerateWaitTime. If the implementation + // of that function changes, then this might + // also need to change without more + // refactoring. + if success == 0 && time.Since(started) > 2*time.Second { return errors.New("failed to submit any transactions") } + + // TODO perhaps allow test networks to + // declare required transaction rates, which + // might allow us to avoid the special case + // around 0 txs above. rate := float64(success) / time.Since(started).Seconds() logger.Info("ending transaction load",