Skip to content

Commit

Permalink
fixing unit test
Browse files Browse the repository at this point in the history
Signed-off-by: Jaydip Gabani <[email protected]>
  • Loading branch information
JaydipGabani committed Jan 16, 2024
1 parent 20b8d79 commit 9aa132e
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions pkg/syncutil/stats_reporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ func initializeTestInstruments(t *testing.T) (rdr *sdkmetric.PeriodicReader, r *
mp := sdkmetric.NewMeterProvider(sdkmetric.WithReader(rdr))
meter = mp.Meter("test")

r, err = NewStatsReporter()
assert.NoError(t, err)
r = &Reporter{now: now}
_, err = meter.Int64ObservableGauge(syncMetricName, metric.WithInt64Callback(r.observeSync))
assert.NoError(t, err)
syncDurationM, err = meter.Float64Histogram(syncDurationMetricName)
Expand Down Expand Up @@ -79,17 +78,15 @@ func TestReportSync(t *testing.T) {

for kind := range tt.c.KnownKinds {
for _, status := range metrics.AllStatuses {
if err := r.ReportSync(
r.ReportSync(

Check failure on line 81 in pkg/syncutil/stats_reporter_test.go

View workflow job for this annotation

GitHub Actions / Lint

Error return value of `r.ReportSync` is not checked (errcheck)
Tags{
Kind: kind,
Status: status,
},
int64(totals[Tags{
Kind: kind,
Status: status,
}])); err != nil {
log.Error(err, "failed to report sync")
}
}]))
}
}

Expand Down

0 comments on commit 9aa132e

Please sign in to comment.