Skip to content

Commit

Permalink
roachtest: remove confusing "--- PASS" log lines
Browse files Browse the repository at this point in the history
Two workloads were printing PASS/FAIL lines from inside the predicates
passed to Searcher.Search. This is really confusing when reading the
test's output, because they don't correspond to the test's disposition.

Release note: None
  • Loading branch information
andreimatei committed Aug 3, 2020
1 parent 470510e commit d1d27ba
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 18 deletions.
29 changes: 13 additions & 16 deletions pkg/cmd/roachtest/kvbench.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,18 +314,22 @@ func runKVBench(ctx context.Context, t *test, c *cluster, b kvBenchSpec) {
}
close(resultChan)
res := <-resultChan
failErr := res.failureError(b)
if failErr == nil {
ttycolor.Stdout(ttycolor.Green)
t.l.Printf(`--- PASS: kv workload maintained an average latency of %0.1fms`+
` with avg throughput of %d`, res.latency(), res.throughput())

var color ttycolor.Code
var msg string
pass := res.latency() <= b.LatencyThresholdMs
if pass {
color = ttycolor.Green
msg = "PASS"
} else {
ttycolor.Stdout(ttycolor.Red)
t.l.Printf(`--- FAIL: kv workload maintained an average latency of %0.1fms (threshold: %0.1fms)`+
` with avg throughput of %d`, res.latency(), b.LatencyThresholdMs, res.throughput())
color = ttycolor.Red
msg = "FAIL"
}
ttycolor.Stdout(color)
t.l.Printf(`--- SEARCH ITER %s: kv workload avg latency: %0.1fms (threshold: %0.1fms), avg throughput: %d`,
msg, res.latency(), b.LatencyThresholdMs, res.throughput())
ttycolor.Stdout(ttycolor.Reset)
return failErr == nil, nil
return pass, nil
}
if res, err := s.Search(searchPredicate); err != nil {
t.Fatal(err)
Expand Down Expand Up @@ -381,10 +385,3 @@ func (r kvBenchResult) throughput() int {
// compute the average throughput here but not much more than that.
return int(float64(r.Cumulative[`write`].TotalCount()) / r.Elapsed.Seconds())
}

func (r kvBenchResult) failureError(b kvBenchSpec) error {
if r.latency() <= b.LatencyThresholdMs {
return nil
}
return errors.Errorf(`average latency is too high %0.1fms`, r.latency())
}
4 changes: 2 additions & 2 deletions pkg/cmd/roachtest/tpcc.go
Original file line number Diff line number Diff line change
Expand Up @@ -890,11 +890,11 @@ func runTPCCBench(ctx context.Context, t *test, c *cluster, b tpccBenchSpec) {
// Print the result.
if failErr == nil {
ttycolor.Stdout(ttycolor.Green)
t.l.Printf("--- PASS: tpcc %d resulted in %.1f tpmC (%.1f%% of max tpmC)\n\n",
t.l.Printf("--- SEARCH ITER PASS: TPCC %d resulted in %.1f tpmC (%.1f%% of max tpmC)\n\n",
warehouses, res.TpmC(), res.Efficiency())
} else {
ttycolor.Stdout(ttycolor.Red)
t.l.Printf("--- FAIL: tpcc %d resulted in %.1f tpmC and failed due to %v",
t.l.Printf("--- SEARCH ITER FAIL: TPCC %d resulted in %.1f tpmC and failed due to %v",
warehouses, res.TpmC(), failErr)
}
ttycolor.Stdout(ttycolor.Reset)
Expand Down

0 comments on commit d1d27ba

Please sign in to comment.