Skip to content

Commit 41f6db1

Browse files
committed
server: accept timer_rego_external_resolve_ns metrics with value 0
When running the tests in a loop for a while, I would see values of 0ns for this metric. However, comparing with its non-zero values, which are often 41 or 42ns, it seems like this is just not happening in this code path. So if "almost nothing" actually goes below 1ns, it's OK. Signed-off-by: Stephan Renatus <[email protected]>
1 parent ddd1627 commit 41f6db1

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

v1/server/compile_handler_test.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -228,11 +228,10 @@ func TestCompileHandlerMetrics(t *testing.T) {
228228
}
229229
}
230230

231-
// compareMetrics only checks that the keys of `exp` and `act` are the same,
232-
// and that all values of `act` are non-zero.
231+
// compareMetrics only checks that the keys of `exp` and `act` are the same.
233232
func compareMetrics(exp, act map[string]float64) bool {
234-
return maps.EqualFunc(exp, act, func(_, b float64) bool {
235-
return b != 0
233+
return maps.EqualFunc(exp, act, func(_, _ float64) bool {
234+
return true
236235
})
237236
}
238237

0 commit comments

Comments
 (0)