Skip to content

Commit 41ac539

Browse files
authored
remove print rate from load and update test steps fail (#169)
Signed-off-by: May.Buzaglo <May.Buzaglo@ibm.com>
1 parent 0ed6792 commit 41ac539

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

common/tools/armageddon/armageddon.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -490,10 +490,9 @@ func load(userConfigFile **os.File, transactions *int, rate *string, txSize *int
490490
fmt.Fprintf(os.Stderr, "Error reading config: %s", err)
491491
os.Exit(-1)
492492
}
493-
converted_rates := make([]int, len(rates))
493+
convertedRates := make([]int, len(rates))
494494
for i := 0; i < len(rates); i++ {
495-
fmt.Print(rates[i])
496-
converted_rates[i], err = strconv.Atoi(rates[i])
495+
convertedRates[i], err = strconv.Atoi(rates[i])
497496
if err != nil {
498497
fmt.Fprintf(os.Stderr, "rate is not valid: %s", err)
499498
os.Exit(-1)
@@ -502,7 +501,7 @@ func load(userConfigFile **os.File, transactions *int, rate *string, txSize *int
502501
// send txs to the routers
503502
for i := 0; i < len(rates); i++ {
504503
start := time.Now()
505-
sendTxToRouters(userConfig, *transactions, converted_rates[i], *txSize, nil)
504+
sendTxToRouters(userConfig, *transactions, convertedRates[i], *txSize, nil)
506505
elapsed := time.Since(start)
507506
reportLoadResults(*transactions, elapsed, *txSize)
508507
}

common/tools/armageddon/armageddon_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,9 @@ func TestLoadStepsFails(t *testing.T) {
201201
require.NotNil(t, armageddonBinary)
202202
cmd := exec.Command(armageddonBinary, "load", "--config", userConfigPath, "--transactions", txsSent, "--rate", rates, "--txSize", txSize)
203203
require.NotNil(t, cmd)
204-
stdout, err := cmd.Output()
204+
output, err := cmd.CombinedOutput()
205205
// Check if the command returned an error and the output contains the expected error message
206-
require.Contains(t, string(stdout), "BOOM")
206+
require.Contains(t, string(output), "rate is not valid")
207207
require.Contains(t, err.Error(), "exit status")
208208
}
209209

0 commit comments

Comments
 (0)