MCPcopy
hub / github.com/segmentio/kafka-go / testConnFindCoordinator

Function testConnFindCoordinator

conn_test.go:744–771  ·  view source on GitHub ↗
(t *testing.T, conn *Conn)

Source from the content-addressed store, hash-verified

742}
743
744func testConnFindCoordinator(t *testing.T, conn *Conn) {
745 groupID := makeGroupID()
746
747 for attempt := 0; attempt < 10; attempt++ {
748 if attempt != 0 {
749 time.Sleep(time.Millisecond * 50)
750 }
751 response, err := conn.findCoordinator(findCoordinatorRequestV0{CoordinatorKey: groupID})
752 if err != nil {
753 if errors.Is(err, GroupCoordinatorNotAvailable) {
754 continue
755 }
756
757 t.Fatalf("bad findCoordinator: %s", err)
758 }
759
760 if response.Coordinator.NodeID == 0 {
761 t.Errorf("bad NodeID")
762 }
763 if response.Coordinator.Host == "" {
764 t.Errorf("bad Host")
765 }
766 if response.Coordinator.Port == 0 {
767 t.Errorf("bad Port")
768 }
769 return
770 }
771}
772
773func testConnJoinGroupInvalidGroupID(t *testing.T, conn *Conn) {
774 _, err := conn.joinGroup(joinGroupRequest{})

Callers

nothing calls this directly

Calls 2

makeGroupIDFunction · 0.85
findCoordinatorMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…