usagestats tests: don't check unpredictable number (#5840)

If this test is run alongside a number of other tests then the number of
goroutines can change between when the report is generated and when the
result is checked, which will cause the test to fail.
pull/5846/head
Bryan Boreham 3 years ago committed by GitHub
parent fcb9812f5d
commit eeb8b40eaa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      pkg/usagestats/stats_test.go

@ -50,7 +50,7 @@ func Test_BuildReport(t *testing.T) {
require.Equal(t, r.Edition, "OSS")
require.Equal(t, r.Target, "compactor")
require.Equal(t, r.Metrics["num_cpu"], runtime.NumCPU())
require.Equal(t, r.Metrics["num_goroutine"], runtime.NumGoroutine())
// Don't check num_goroutine because it could have changed since the report was created.
require.Equal(t, r.Metrics["compression"], "lz4")
require.Equal(t, r.Metrics["compression_ratio"], int64(100))
require.Equal(t, r.Metrics["size_mb"], 200.1)

Loading…
Cancel
Save