MCPcopy
hub / github.com/CodisLabs/codis / newFakeServer

Function newFakeServer

pkg/topom/topom_stats_test.go:130–145  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

128}
129
130func newFakeServer() *fakeServer {
131 l, err := net.Listen("tcp", "127.0.0.1:0")
132 assert.MustNoError(err)
133 f := &fakeServer{Listener: l, Addr: l.Addr().String()}
134 go func() {
135 for {
136 c, err := l.Accept()
137 if err != nil {
138 return
139 }
140 f.PushBack(c)
141 go f.Serve(c)
142 }
143 }()
144 return f
145}
146
147func (s *fakeServer) Close() error {
148 for e := s.List.Front(); e != nil; e = e.Next() {

Callers 6

TestSlotActionFunction · 0.85
TestSyncActionFunction · 0.85
TestGroupPromoteFunction · 0.85
TestApiSlotsFunction · 0.85
TestApiGroupFunction · 0.85
TestRedisStatsFunction · 0.85

Calls 4

ServeMethod · 0.95
StringMethod · 0.45
AddrMethod · 0.45
PushBackMethod · 0.45

Tested by

no test coverage detected