diff --git a/orderer/kafka/chain_test.go b/orderer/kafka/chain_test.go index b9ad41bfb7d..2e92afe2a9a 100644 --- a/orderer/kafka/chain_test.go +++ b/orderer/kafka/chain_test.go @@ -31,7 +31,7 @@ var ( ) func TestChain(t *testing.T) { - mockChannel := newChannel("channelFoo", defaultPartition) + mockChannel := newChannel("foo.channel", defaultPartition) oldestOffset := int64(0) newestOffset := int64(5) @@ -334,7 +334,7 @@ func TestSetupProducerForChannel(t *testing.T) { mockBroker := sarama.NewMockBroker(t, 0) defer mockBroker.Close() - mockChannel := newChannel("channelFoo", defaultPartition) + mockChannel := newChannel("foo.channel", defaultPartition) haltChan := make(chan struct{}) @@ -359,7 +359,7 @@ func TestSetupConsumerForChannel(t *testing.T) { mockBroker := sarama.NewMockBroker(t, 0) defer func() { mockBroker.Close() }() - mockChannel := newChannel("channelFoo", defaultPartition) + mockChannel := newChannel("foo.channel", defaultPartition) oldestOffset := int64(0) newestOffset := int64(5) @@ -410,7 +410,7 @@ func TestSetupConsumerForChannel(t *testing.T) { } func TestCloseKafkaObjects(t *testing.T) { - mockChannel := newChannel("channelFoo", defaultPartition) + mockChannel := newChannel("foo.channel", defaultPartition) mockSupport := &mockmultichain.ConsenterSupport{ ChainIDVal: mockChannel.topic(), @@ -524,7 +524,7 @@ func TestGetLastCutBlockNumber(t *testing.T) { } func TestGetLastOffsetPersisted(t *testing.T) { - mockChannel := newChannel("channelFoo", defaultPartition) + mockChannel := newChannel("foo.channel", defaultPartition) mockMetadata := &cb.Metadata{Value: utils.MarshalOrPanic(&ab.KafkaMetadata{LastOffsetPersisted: int64(5)})} testCases := []struct { diff --git a/orderer/kafka/channel_test.go b/orderer/kafka/channel_test.go index b838ee7fa33..ddeae89b6ca 100644 --- a/orderer/kafka/channel_test.go +++ b/orderer/kafka/channel_test.go @@ -24,9 +24,9 @@ import ( ) func TestChannel(t *testing.T) { - chn := newChannel("channelFoo", defaultPartition) + chn := newChannel("foo.channel", defaultPartition) - expectedTopic := fmt.Sprintf("%s", "channelFoo") + expectedTopic := fmt.Sprintf("%s", "foo.channel") actualTopic := chn.topic() assert.Equal(t, expectedTopic, actualTopic, "Got the wrong topic, expected %s, got %s instead", expectedTopic, actualTopic) diff --git a/orderer/kafka/config_test.go b/orderer/kafka/config_test.go index 888ce6f3bd7..071654246fc 100644 --- a/orderer/kafka/config_test.go +++ b/orderer/kafka/config_test.go @@ -17,10 +17,10 @@ import ( ) func TestBrokerConfig(t *testing.T) { - mockChannel1 := newChannel("channelFoo", defaultPartition) + mockChannel1 := newChannel("foo.channel", defaultPartition) // Use a partition ID that is not the 'default' (defaultPartition) var differentPartition int32 = defaultPartition + 1 - mockChannel2 := newChannel("channelFoo", differentPartition) + mockChannel2 := newChannel("foo.channel", differentPartition) mockBroker := sarama.NewMockBroker(t, 0) defer func() { mockBroker.Close() }() diff --git a/orderer/kafka/consenter_test.go b/orderer/kafka/consenter_test.go index 9b6a02fa8cc..251b59d924e 100644 --- a/orderer/kafka/consenter_test.go +++ b/orderer/kafka/consenter_test.go @@ -67,7 +67,7 @@ func TestHandleChain(t *testing.T) { newestOffset := int64(5) message := sarama.StringEncoder("messageFoo") - mockChannel := newChannel("channelFoo", defaultPartition) + mockChannel := newChannel("foo.channel", defaultPartition) mockBroker := sarama.NewMockBroker(t, 0) mockBroker.SetHandlerByMap(map[string]sarama.MockResponse{ @@ -113,7 +113,6 @@ func extractEncodedOffset(marshalledOrdererMetadata []byte) int64 { func newMockBrokerConfig(tlsConfig localconfig.TLS, retryOptions localconfig.Retry, kafkaVersion sarama.KafkaVersion, chosenStaticPartition int32) *sarama.Config { brokerConfig := newBrokerConfig(tlsConfig, retryOptions, kafkaVersion, chosenStaticPartition) brokerConfig.ClientID = "test" - brokerConfig.Producer.MaxMessageBytes-- // FIXME https://jira.hyperledger.org/browse/FAB-4083 return brokerConfig } diff --git a/orderer/kafka/partitioner_test.go b/orderer/kafka/partitioner_test.go index b60bb2c192f..8ee645bbcbe 100644 --- a/orderer/kafka/partitioner_test.go +++ b/orderer/kafka/partitioner_test.go @@ -18,7 +18,7 @@ func TestStaticPartitioner(t *testing.T) { var numberOfPartitions int32 = 6 partitionerConstructor := newStaticPartitioner(partition) - partitioner := partitionerConstructor("channelFoo") + partitioner := partitionerConstructor("foo.channel") for i := 0; i < 10; i++ { assignedPartition, err := partitioner.Partition(new(sarama.ProducerMessage), numberOfPartitions) diff --git a/orderer/kafka/retry_test.go b/orderer/kafka/retry_test.go index 679f21fc613..3f534bd5b00 100644 --- a/orderer/kafka/retry_test.go +++ b/orderer/kafka/retry_test.go @@ -16,7 +16,7 @@ import ( func TestRetry(t *testing.T) { var rp *retryProcess - mockChannel := newChannel("channelFoo", defaultPartition) + mockChannel := newChannel("foo.channel", defaultPartition) flag := false noErrorFn := func() error {