Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
njo committed Oct 11, 2024
1 parent 52d7430 commit bd4b913
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions common/metrics/metricstest/capture_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
package metricstest

import (
"io"
"sync"
"time"

Expand Down Expand Up @@ -142,5 +143,13 @@ func (c *CaptureHandler) Histogram(name string, unit metrics.MetricUnit) metrics
return metrics.HistogramFunc(func(v int64, tags ...metrics.Tag) { c.record(name, v, unit, tags...) })
}

func (c *CaptureHandler) Close() error {
return nil
}

func (c *CaptureHandler) BatchStart(_ string) (metrics.Handler, io.Closer) {
return c, c
}

// Stop implements [metrics.Handler.Stop].
func (*CaptureHandler) Stop(log.Logger) {}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
package historybuilder

import (
"io"
"testing"
"time"

Expand Down Expand Up @@ -66,6 +67,14 @@ func (h StubHandler) Histogram(_ string, _ metrics.MetricUnit) metrics.Histogram

func (h StubHandler) Stop(_ log.Logger) {}

func (h StubHandler) Close() error {
return nil
}

func (h StubHandler) BatchStart(_ string) (metrics.Handler, io.Closer) {
return h, h
}

func TestHistoryBuilder_IsDirty(t *testing.T) {
hb := HistoryBuilder{EventStore: EventStore{}}
if hb.IsDirty() {
Expand Down

0 comments on commit bd4b913

Please sign in to comment.