diff --git a/hack/benchmark/core/benchmark/strategy/bulk_insert.go b/hack/benchmark/core/benchmark/strategy/bulk_insert.go index cc3c3069ba..8846ea1014 100644 --- a/hack/benchmark/core/benchmark/strategy/bulk_insert.go +++ b/hack/benchmark/core/benchmark/strategy/bulk_insert.go @@ -46,7 +46,7 @@ func NewBulkInsert(opts ...StrategyOption) benchmark.Strategy { for i := 0; i < size; i++ { arr, err := dataset.Train(i) if err != nil { - break + b.Fatal(err) } v = append(v, arr.([]float32)) } @@ -72,7 +72,7 @@ func NewBulkInsert(opts ...StrategyOption) benchmark.Strategy { for i := 0; i < size; i++ { arr, err := dataset.Train(i) if err != nil { - break + b.Fatal(err) } v = append(v, float32To64(arr.([]float32))) } diff --git a/hack/benchmark/core/benchmark/strategy/bulk_insert_commit.go b/hack/benchmark/core/benchmark/strategy/bulk_insert_commit.go index a618e664d8..80eea2a5b1 100644 --- a/hack/benchmark/core/benchmark/strategy/bulk_insert_commit.go +++ b/hack/benchmark/core/benchmark/strategy/bulk_insert_commit.go @@ -42,7 +42,7 @@ func NewBulkInsertCommit(poolSize uint32, opts ...StrategyOption) benchmark.Stra for i := 0; i < size; i++ { arr, err := dataset.Train(i) if err != nil { - break + b.Fatal(err) } v = append(v, arr.([]float32)) } @@ -68,7 +68,7 @@ func NewBulkInsertCommit(poolSize uint32, opts ...StrategyOption) benchmark.Stra for i := 0; i < size; i++ { arr, err := dataset.Train(i) if err != nil { - break + b.Fatal(err) } v = append(v, float32To64(arr.([]float32))) } diff --git a/hack/benchmark/internal/e2e/strategy/insert.go b/hack/benchmark/internal/e2e/strategy/insert.go index c655e9aa21..4baf51f953 100644 --- a/hack/benchmark/internal/e2e/strategy/insert.go +++ b/hack/benchmark/internal/e2e/strategy/insert.go @@ -58,8 +58,7 @@ func (isrt *insert) run(ctx context.Context, b *testing.B, c client.Client, data for i := 0; i < bb.N; i++ { v, err := dataset.Train(cnt % dataset.TrainSize()) if err != nil { - cnt = 0 - break + b.Fatal(err) } isrt.do(ctx, bb, c, fmt.Sprint(cnt), v.([]float32)) cnt++ @@ -80,8 +79,7 @@ func (isrt *insert) runParallel(ctx context.Context, b *testing.B, c client.Clie n := int(atomic.AddInt64(&cnt, 1)) - 1 v, err := dataset.Train(n % dataset.TrainSize()) if err != nil { - cnt = 0 - break + b.Fatal(err) } isrt.do(ctx, bb, c, fmt.Sprint(cnt), v.([]float32))