Skip to content

Commit

Permalink
Fix data race in consumer_test.go
Browse files Browse the repository at this point in the history
  • Loading branch information
wvanbergen committed Mar 12, 2015
1 parent 8e13cd0 commit 7fd499b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions consumer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,18 +87,18 @@ func TestConsumerLatestOffset(t *testing.T) {
t.Error("Latest message offset not fetched correctly:", msg.Offset)
}

// we deliver one message, so it should be one higher than we return in the OffsetResponse
// this way it is set correctly for the next FetchRequest.
if consumer.(*partitionConsumer).offset != 0x010102 {
t.Error("Latest offset not fetched correctly:", consumer.(*partitionConsumer).offset)
}

if hwmo := consumer.HighWaterMarkOffset(); hwmo != 1234 {
t.Errorf("Expected high water mark offset 1234, found %d", hwmo)
}

leader.Close()
safeClose(t, consumer)

// we deliver one message, so it should be one higher than we return in the OffsetResponse
// this way it is set correctly for the next FetchRequest.
if consumer.(*partitionConsumer).offset != 0x010102 {
t.Error("Latest offset not fetched correctly:", consumer.(*partitionConsumer).offset)
}
}

func TestConsumerFunnyOffsets(t *testing.T) {
Expand Down

0 comments on commit 7fd499b

Please sign in to comment.