s3store: Fix failing tests due to missing argument

This commit is contained in:
Marius 2021-06-21 13:15:21 +02:00
parent 946539c3b9
commit 36f12b1d18
1 changed files with 7 additions and 3 deletions

View File

@ -6,6 +6,8 @@ import (
"strings" "strings"
"testing" "testing"
"time" "time"
"github.com/prometheus/client_golang/prometheus"
) )
type InfiniteZeroReader struct{} type InfiniteZeroReader struct{}
@ -21,10 +23,12 @@ func (ErrorReader) Read(b []byte) (int, error) {
return 0, errors.New("error from ErrorReader") return 0, errors.New("error from ErrorReader")
} }
var testSummary = prometheus.NewSummary(prometheus.SummaryOpts{})
func TestPartProducerConsumesEntireReaderWithoutError(t *testing.T) { func TestPartProducerConsumesEntireReaderWithoutError(t *testing.T) {
expectedStr := "test" expectedStr := "test"
r := strings.NewReader(expectedStr) r := strings.NewReader(expectedStr)
pp, fileChan := newS3PartProducer(r, 0, "") pp, fileChan := newS3PartProducer(r, 0, "", testSummary)
go pp.produce(1) go pp.produce(1)
actualStr := "" actualStr := ""
@ -56,7 +60,7 @@ func TestPartProducerConsumesEntireReaderWithoutError(t *testing.T) {
} }
func TestPartProducerExitsWhenProducerIsStopped(t *testing.T) { func TestPartProducerExitsWhenProducerIsStopped(t *testing.T) {
pp, fileChan := newS3PartProducer(InfiniteZeroReader{}, 0, "") pp, fileChan := newS3PartProducer(InfiniteZeroReader{}, 0, "", testSummary)
completedChan := make(chan struct{}) completedChan := make(chan struct{})
go func() { go func() {
@ -77,7 +81,7 @@ func TestPartProducerExitsWhenProducerIsStopped(t *testing.T) {
} }
func TestPartProducerExitsWhenUnableToReadFromFile(t *testing.T) { func TestPartProducerExitsWhenUnableToReadFromFile(t *testing.T) {
pp, fileChan := newS3PartProducer(ErrorReader{}, 0, "") pp, fileChan := newS3PartProducer(ErrorReader{}, 0, "", testSummary)
completedChan := make(chan struct{}) completedChan := make(chan struct{})
go func() { go func() {