MCPcopy
hub / github.com/IBM/sarama / testFuncConsumerGroupFuzzySeed

Function testFuncConsumerGroupFuzzySeed

functional_consumer_group_test.go:316–347  ·  view source on GitHub ↗
(topic string)

Source from the content-addressed store, hash-verified

314}
315
316func testFuncConsumerGroupFuzzySeed(topic string) error {
317 client, err := NewClient(FunctionalTestEnv.KafkaBrokerAddrs, NewFunctionalTestConfig())
318 if err != nil {
319 return err
320 }
321 defer func() { _ = client.Close() }()
322
323 total := int64(0)
324 for pn := int32(0); pn < 4; pn++ {
325 newest, err := client.GetOffset(topic, pn, OffsetNewest)
326 if err != nil {
327 return err
328 }
329 oldest, err := client.GetOffset(topic, pn, OffsetOldest)
330 if err != nil {
331 return err
332 }
333 total = total + newest - oldest
334 }
335 if total >= 7000 {
336 return nil
337 }
338
339 producer, err := NewAsyncProducerFromClient(client)
340 if err != nil {
341 return err
342 }
343 for i := total; i < 7000; i++ {
344 producer.Input() <- &ProducerMessage{Topic: topic, Value: ByteEncoder([]byte("testdata"))}
345 }
346 return producer.Close()
347}
348
349type testFuncConsumerGroupMessage struct {
350 ClientID string

Callers 1

Calls 7

CloseMethod · 0.95
GetOffsetMethod · 0.95
NewFunctionalTestConfigFunction · 0.85
ByteEncoderTypeAlias · 0.85
NewClientFunction · 0.70
InputMethod · 0.65

Tested by

no test coverage detected