From cbc01a4d5c88e8213833d19a1dd949f9043b2548 Mon Sep 17 00:00:00 2001 From: Austen McClernon Date: Thu, 2 Nov 2023 15:51:29 +0000 Subject: [PATCH] roachtest: fix qps parse in kvrestart test The `kv/restart/nodes=12` test could fail when failing to parse the QPS metric value into a uint64. Parse as a float64, then later convert. Epic: none Release note: None --- pkg/cmd/roachtest/tests/kv.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/cmd/roachtest/tests/kv.go b/pkg/cmd/roachtest/tests/kv.go index 33ba2f083acf..af629be226f0 100644 --- a/pkg/cmd/roachtest/tests/kv.go +++ b/pkg/cmd/roachtest/tests/kv.go @@ -924,13 +924,13 @@ func measureQPS( db := db go func() { defer wg.Done() - var v uint64 + var v float64 if err := db.QueryRowContext( ctx, `SELECT value FROM crdb_internal.node_metrics WHERE name = 'sql.insert.count'`, ).Scan(&v); err != nil { t.Fatal(err) } - atomic.AddUint64(&value, v) + atomic.AddUint64(&value, uint64(v)) }() } wg.Wait()