Skip to content

Commit

Permalink
roachtest: fix qps parse in kvrestart test
Browse files Browse the repository at this point in the history
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
  • Loading branch information
kvoli committed Nov 2, 2023
1 parent 13d81ca commit cbc01a4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/cmd/roachtest/tests/kv.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit cbc01a4

Please sign in to comment.