Skip to content
This repository has been archived by the owner on Oct 17, 2018. It is now read-only.

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
Chao Wang committed Oct 8, 2018
1 parent 9b8f49e commit eda3a6c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
12 changes: 10 additions & 2 deletions consumer/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ import (
"testing"
"time"

"github.com/m3db/m3x/instrument"

"github.com/stretchr/testify/require"
yaml "gopkg.in/yaml.v2"
)
Expand All @@ -38,14 +40,20 @@ connectionWriteBufferSize: 200
connectionReadBufferSize: 300
encoder:
maxMessageSize: 100
bytesPool:
watermark:
low: 0.001
decoder:
maxMessageSize: 200
bytesPool:
watermark:
high: 0.002
`

var cfg Configuration
require.NoError(t, yaml.Unmarshal([]byte(str), &cfg))

opts := cfg.NewOptions(nil)
opts := cfg.NewOptions(instrument.NewOptions())
require.Equal(t, 5, opts.MessagePoolOptions().Size())
require.Equal(t, 100*time.Millisecond, opts.AckFlushInterval())
require.Equal(t, 100, opts.AckBufferSize())
Expand All @@ -55,5 +63,5 @@ decoder:
require.NotNil(t, opts.EncoderOptions().BytesPool())
require.Equal(t, 200, opts.DecoderOptions().MaxMessageSize())
require.NotNil(t, opts.EncoderOptions().BytesPool())
require.Nil(t, opts.InstrumentOptions())
require.Equal(t, instrument.NewOptions(), opts.InstrumentOptions())
}
2 changes: 0 additions & 2 deletions producer/config/writer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,5 @@ decoder:
require.Equal(t, 2*time.Millisecond, wOpts.AckErrorRetryOptions().InitialBackoff())
require.Equal(t, 5*time.Second, wOpts.ConnectionOptions().DialTimeout())
require.Equal(t, 100, wOpts.EncoderOptions().MaxMessageSize())
require.NotNil(t, wOpts.EncoderOptions().BytesPool())
require.Equal(t, 200, wOpts.DecoderOptions().MaxMessageSize())
require.NotNil(t, wOpts.DecoderOptions().BytesPool())
}

0 comments on commit eda3a6c

Please sign in to comment.