Skip to content

Commit

Permalink
Merge pull request #866 from twmb/kfake-later
Browse files Browse the repository at this point in the history
kfake: do not listen until the cluster is fully set up
  • Loading branch information
twmb authored Nov 28, 2024
2 parents 3d0d08c + f66d495 commit 605b994
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/kfake/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,9 @@ func NewCluster(opts ...Opt) (*Cluster, error) {
bsIdx: len(c.bs),
}
c.bs = append(c.bs, b)
go b.listen()
defer func() { go b.listen() }()
}
c.controller = c.bs[len(c.bs)-1]
go c.run()

seedTopics := make(map[string]int32)
for _, sts := range cfg.seedTopics {
Expand All @@ -201,6 +200,9 @@ func NewCluster(opts ...Opt) (*Cluster, error) {
for t, p := range seedTopics {
c.data.mkt(t, int(p), -1, nil)
}

go c.run()

return c, nil
}

Expand Down

0 comments on commit 605b994

Please sign in to comment.