Skip to content

Commit 7c99d8f

Browse files
committed
roachtest: actually fail TPCC bench if reached max warehouses
In 1bfe55b, we attempted to fail the TPCC bench test run if the configured maximum warehouses were reached and the success criteria were met. The idea was that this would prompt us to increase the max warehouses. However, that commit failed only the specific line search run, not the full test run. This commit moves the max warehouses check out of the result handling and actually fatals the test. Part of: #148235 Release note: None
1 parent 2f72cf4 commit 7c99d8f

File tree

3 files changed

+19
-18
lines changed

3 files changed

+19
-18
lines changed

pkg/cmd/roachtest/tests/tpcc.go

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2250,7 +2250,22 @@ func runTPCCBench(ctx context.Context, t test.Test, c cluster.Cluster, b tpccBen
22502250
results = append(results, partial)
22512251
}
22522252
res = tpcc.MergeResults(results...)
2253-
failErr = res.FailureError(b.LoadWarehouses(c.Cloud()))
2253+
failErr = res.FailureError()
2254+
// If the active warehouses have reached the load warehouses, fail the test;
2255+
// it needs to be updated to allow for more warehouses. Note that the line
2256+
// search assumes that the test fails at the number of load warehouses, so it
2257+
// never attempts to reach it exactly. Therefore, active warehouses can be at
2258+
// most LoadWarehouses-1.
2259+
if res.ActiveWarehouses >= b.LoadWarehouses(c.Cloud())-1 {
2260+
err = errors.CombineErrors(
2261+
failErr,
2262+
errors.Errorf(
2263+
"the number of active warehouses (%d) reached the maximum number of "+
2264+
"warehouses; consider updating LoadWarehouses and EstimatedMax", res.ActiveWarehouses,
2265+
),
2266+
)
2267+
t.Fatal(err)
2268+
}
22542269
}
22552270

22562271
// Print the result.
@@ -2681,7 +2696,7 @@ func runTPCCPublished(
26812696
results = append(results, partial)
26822697
}
26832698
res = tpcc.MergeResults(results...)
2684-
failErr = res.FailureError(opts.LoadWarehousesGCE)
2699+
failErr = res.FailureError()
26852700
}
26862701

26872702
// Print result for current iteration

pkg/workload/tpcc/result.go

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ func (r *Result) Efficiency() float64 {
169169

170170
// FailureError returns nil if the Result is passing or an error describing
171171
// the failure if the result is failing.
172-
func (r *Result) FailureError(loadWarehouses int) error {
172+
func (r *Result) FailureError() error {
173173
if _, newOrderExists := r.Cumulative["newOrder"]; !newOrderExists {
174174
return errors.Errorf("no newOrder data exists")
175175
}
@@ -193,19 +193,5 @@ func (r *Result) FailureError(loadWarehouses int) error {
193193
query, v, max90th))
194194
}
195195
}
196-
// If the active warehouses have reached the load warehouses, fail the test;
197-
// it needs to be updated to allow for more warehouses. Note that the line
198-
// search assumes that the test fails at the number of load warehouses, so it
199-
// never attempts to reach it exactly. Therefore, active warehouses can be at
200-
// most loadWarehouses - 1.
201-
if r.ActiveWarehouses >= loadWarehouses-1 {
202-
err = errors.CombineErrors(
203-
err,
204-
errors.Errorf(
205-
"the number of active warehouses (%d) reached the maximum number of "+
206-
"warehouses; consider updating LoadWarehouses and EstimatedMax", r.ActiveWarehouses,
207-
),
208-
)
209-
}
210196
return err
211197
}

pkg/workload/tpcc/result_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ func TestNewResult(t *testing.T) {
1515
// Ensure you don't get panics when calling common methods
1616
// on a trivial Result that doesn't have any data attached.
1717
res := NewResult(1000, 0, 0, nil)
18-
require.Error(t, res.FailureError(0))
18+
require.Error(t, res.FailureError())
1919
require.Zero(t, res.Efficiency())
2020
require.Zero(t, res.TpmC())
2121
}

0 commit comments

Comments
 (0)