Skip to content

Commit

Permalink
Fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
bai committed Jan 16, 2021
1 parent 4972173 commit 906686c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions core/internal/consumer/kafka_zk_test.go
Expand Up @@ -178,8 +178,8 @@ func TestKafkaZkClient_watchGroupList(t *testing.T) {

func TestKafkaZkClient_resetOffsetWatchAndSend_BadPath(t *testing.T) {
mockZookeeper := helpers.MockZookeeperClient{}
mockZookeeper.On("GetW", "/consumers/testgroup/offsets/testtopic/0").Return([]byte("81234"), (*zk.Stat)(nil), (<-chan zk.Event)(nil), errors.New("badpath"))
mockZookeeper.On("GetW", "/consumers/testgroup/owners/testtopic/0").Return([]byte("testowner"), (*zk.Stat)(nil), (<-chan zk.Event)(nil), nil)
mockZookeeper.On("GetW", "/consumers/testgroup/offsets/testtopic/0").Return([]byte("81234"), (*zk.Stat)(nil), <-chan zk.Event(nil), errors.New("badpath"))
mockZookeeper.On("GetW", "/consumers/testgroup/owners/testtopic/0").Return([]byte("testowner"), (*zk.Stat)(nil), <-chan zk.Event(nil), nil)

module := fixtureKafkaZkModule()
module.Configure("test", "consumer.test")
Expand All @@ -200,7 +200,7 @@ func TestKafkaZkClient_resetOffsetWatchAndSend_BadOffset(t *testing.T) {
offsetStat := &zk.Stat{Mtime: 894859}
newWatchEventChan := make(chan zk.Event)
mockZookeeper.On("GetW", "/consumers/testgroup/offsets/testtopic/0").Return([]byte("notanumber"), offsetStat, func() <-chan zk.Event { return newWatchEventChan }(), nil)
mockZookeeper.On("GetW", "/consumers/testgroup/owners/testtopic/0").Return([]byte("testowner"), (*zk.Stat)(nil), (<-chan zk.Event)(nil), nil)
mockZookeeper.On("GetW", "/consumers/testgroup/owners/testtopic/0").Return([]byte("testowner"), (*zk.Stat)(nil), <-chan zk.Event(nil), nil)

// This will block if a storage request is sent, as nothing is watching that channel
module.running.Add(1)
Expand All @@ -218,7 +218,7 @@ func TestKafkaZkClient_resetOffsetWatchAndSend_BadOffset(t *testing.T) {

func TestKafkaZkClient_resetPartitionListWatchAndAdd_BadPath(t *testing.T) {
mockZookeeper := helpers.MockZookeeperClient{}
mockZookeeper.On("ChildrenW", "/consumers/testgroup/offsets/testtopic").Return([]string{}, (*zk.Stat)(nil), (<-chan zk.Event)(nil), errors.New("badpath"))
mockZookeeper.On("ChildrenW", "/consumers/testgroup/offsets/testtopic").Return([]string{}, (*zk.Stat)(nil), <-chan zk.Event(nil), errors.New("badpath"))

module := fixtureKafkaZkModule()
module.Configure("test", "consumer.test")
Expand Down Expand Up @@ -252,7 +252,7 @@ func TestKafkaZkClient_resetTopicListWatchAndAdd_BadPath(t *testing.T) {

func TestKafkaZkClient_resetGroupListWatchAndAdd_BadPath(t *testing.T) {
mockZookeeper := helpers.MockZookeeperClient{}
mockZookeeper.On("ChildrenW", "/consumers").Return([]string{}, (*zk.Stat)(nil), (<-chan zk.Event)(nil), errors.New("badpath"))
mockZookeeper.On("ChildrenW", "/consumers").Return([]string{}, (*zk.Stat)(nil), <-chan zk.Event(nil), errors.New("badpath"))

module := fixtureKafkaZkModule()
module.Configure("test", "consumer.test")
Expand Down

0 comments on commit 906686c

Please sign in to comment.