Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
atanasdinov committed Oct 26, 2021
1 parent 1935fbd commit b1d57b6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: localhost:2181
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092,PLAINTEXT_HOST://localhost:29092
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:9092,PLAINTEXT_HOST://localhost:29092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
Expand Down
7 changes: 4 additions & 3 deletions consumer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ func TestConsumer_InvalidConnection(t *testing.T) {
Topics: []string{testTopic},
Options: nil,
},
logger: log,
consumerGroupLock: &sync.RWMutex{},
logger: log,
}

assert.Error(t, consumer.ConnectivityCheck())
Expand All @@ -64,13 +65,13 @@ func TestKafkaConsumer_StartListening(t *testing.T) {

consumer := NewConsumer(config, log, time.Second)

consumer.StartListening(func(msg FTMessage) {})
go consumer.StartListening(func(msg FTMessage) {})

time.Sleep(3 * time.Second)

assert.NoError(t, consumer.ConnectivityCheck())

time.Sleep(1 * time.Second)
time.Sleep(3 * time.Second)

assert.NoError(t, consumer.Close())
}
Expand Down
3 changes: 0 additions & 3 deletions producer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ func TestProducer_SendMessage(t *testing.T) {
}
assert.NoError(t, producer.SendMessage(msg))

msg = NewFTMessage(nil, `{"foo":"bar"}`)
assert.NoError(t, producer.SendMessage(msg))

assert.NoError(t, producer.Close())
}

Expand Down

0 comments on commit b1d57b6

Please sign in to comment.