Skip to content

Commit

Permalink
fix(loadtest): panic when cut off brutally with ctrl+c (#139)
Browse files Browse the repository at this point in the history
* fix: loadtest panic when cut off brutally with `ctrl+c`

* chore: nit

* chore: remove log msg

* chore: early return
  • Loading branch information
leovct authored Oct 23, 2023
1 parent 2521535 commit f5f7798
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmd/loadtest/loadtest.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,12 @@ func completeLoadTest(ctx context.Context, c *ethclient.Client, rpc *ethrpc.Clie
if err != nil {
log.Error().Err(err).Msg("There was an issue waiting for all transactions to be mined")
}
endTime := time.Now()
if len(loadTestResults) == 0 {
return errors.New("no transactions observed")
}

startTime := loadTestResults[0].RequestTime
endTime := time.Now()
log.Debug().Uint64("currentNonce", currentNonce).Uint64("final block number", finalBlockNumber).Msg("Got final block number")

if *inputLoadTestParams.ShouldProduceSummary {
Expand Down

0 comments on commit f5f7798

Please sign in to comment.