e2e: reduce load volume (#6932)

This commit is contained in:
Sam Kleinman
2021-09-13 13:45:01 -04:00
committed by GitHub
parent 723bf92ebb
commit abbe8209b5
+3 -3
View File
@@ -78,8 +78,8 @@ func Load(ctx context.Context, testnet *e2e.Testnet) error {
//
// The chTx has multiple consumers, thus the rate limiting of the load
// generation is primarily the result of backpressure from the
// broadcast transaction, though at most one transaction will be
// produced every 10ms.
// broadcast transaction, though there is still some timer-based
// limiting.
func loadGenerate(ctx context.Context, chTx chan<- types.Tx, size int64) {
timer := time.NewTimer(0)
defer timer.Stop()
@@ -109,7 +109,7 @@ func loadGenerate(ctx context.Context, chTx chan<- types.Tx, size int64) {
case chTx <- tx:
// sleep for a bit before sending the
// next transaction.
waitTime := (10 * time.Millisecond) + time.Duration(rand.Int63n(int64(500*time.Millisecond))) // nolint: gosec
waitTime := (25 * time.Millisecond) + time.Duration(rand.Int63n(int64(750*time.Millisecond))) // nolint: gosec
timer.Reset(waitTime)
}