mirror of
https://github.com/fluencelabs/tendermint
synced 2025-05-24 03:31:21 +00:00
tools/tm-bench: bounds check for txSize and improving test cases (#2410)
Fixes #2409
This commit is contained in:
parent
e3e3c13741
commit
c6c0b52d0c
@ -25,7 +25,7 @@ func main() {
|
|||||||
flagSet.IntVar(&connections, "c", 1, "Connections to keep open per endpoint")
|
flagSet.IntVar(&connections, "c", 1, "Connections to keep open per endpoint")
|
||||||
flagSet.IntVar(&durationInt, "T", 10, "Exit after the specified amount of time in seconds")
|
flagSet.IntVar(&durationInt, "T", 10, "Exit after the specified amount of time in seconds")
|
||||||
flagSet.IntVar(&txsRate, "r", 1000, "Txs per second to send in a connection")
|
flagSet.IntVar(&txsRate, "r", 1000, "Txs per second to send in a connection")
|
||||||
flagSet.IntVar(&txSize, "s", 250, "The size of a transaction in bytes.")
|
flagSet.IntVar(&txSize, "s", 250, "The size of a transaction in bytes, must be greater than or equal to 40.")
|
||||||
flagSet.StringVar(&outputFormat, "output-format", "plain", "Output format: plain or json")
|
flagSet.StringVar(&outputFormat, "output-format", "plain", "Output format: plain or json")
|
||||||
flagSet.StringVar(&broadcastTxMethod, "broadcast-tx-method", "async", "Broadcast method: async (no guarantees; fastest), sync (ensures tx is checked) or commit (ensures tx is checked and committed; slowest)")
|
flagSet.StringVar(&broadcastTxMethod, "broadcast-tx-method", "async", "Broadcast method: async (no guarantees; fastest), sync (ensures tx is checked) or commit (ensures tx is checked and committed; slowest)")
|
||||||
flagSet.BoolVar(&verbose, "v", false, "Verbose output")
|
flagSet.BoolVar(&verbose, "v", false, "Verbose output")
|
||||||
@ -68,6 +68,14 @@ Examples:
|
|||||||
fmt.Printf("Running %ds test @ %s\n", durationInt, flagSet.Arg(0))
|
fmt.Printf("Running %ds test @ %s\n", durationInt, flagSet.Arg(0))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if txSize < 40 {
|
||||||
|
fmt.Fprintln(
|
||||||
|
os.Stderr,
|
||||||
|
"The size of a transaction must be greater than or equal to 40.",
|
||||||
|
)
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
|
||||||
if broadcastTxMethod != "async" &&
|
if broadcastTxMethod != "async" &&
|
||||||
broadcastTxMethod != "sync" &&
|
broadcastTxMethod != "sync" &&
|
||||||
broadcastTxMethod != "commit" {
|
broadcastTxMethod != "commit" {
|
||||||
|
@ -22,7 +22,7 @@ func TestGenerateTxUpdateTxConsistentency(t *testing.T) {
|
|||||||
hostname string
|
hostname string
|
||||||
numTxsToTest int
|
numTxsToTest int
|
||||||
}{
|
}{
|
||||||
{0, 0, 50, "localhost:26657", 1000},
|
{0, 0, 40, "localhost:26657", 1000},
|
||||||
{70, 300, 10000, "localhost:26657", 1000},
|
{70, 300, 10000, "localhost:26657", 1000},
|
||||||
{0, 50, 100000, "localhost:26657", 1000},
|
{0, 50, 100000, "localhost:26657", 1000},
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user