MCPcopy Index your code
hub / github.com/CodisLabs/codis / TestStartAndShutdown

Function TestStartAndShutdown

pkg/proxy/proxy_test.go:113–140  ·  view source on GitHub ↗
(x *testing.T)

Source from the content-addressed store, hash-verified

111}
112
113func TestStartAndShutdown(x *testing.T) {
114 s, addr := openProxy()
115 defer s.Close()
116
117 var c = NewApiClient(addr)
118 c.SetXAuth(config.ProductName, config.ProductAuth, s.Model().Token)
119
120 expect := make(map[int]*models.Slot)
121
122 for i := 0; i < 16; i++ {
123 slot := &models.Slot{
124 Id: i,
125 BackendAddr: "x.x.x.x:xxxx",
126 }
127 assert.MustNoError(c.FillSlots(slot))
128 expect[i] = slot
129 }
130 verifySlots(c, expect)
131
132 err1 := c.Start()
133 assert.MustNoError(err1)
134
135 err2 := c.Shutdown()
136 assert.MustNoError(err2)
137
138 err3 := c.Start()
139 assert.Must(err3 != nil)
140}

Callers

nothing calls this directly

Calls 9

verifySlotsFunction · 0.85
openProxyFunction · 0.70
NewApiClientFunction · 0.70
CloseMethod · 0.65
SetXAuthMethod · 0.45
ModelMethod · 0.45
FillSlotsMethod · 0.45
StartMethod · 0.45
ShutdownMethod · 0.45

Tested by

no test coverage detected