MCPcopy Index your code
hub / github.com/gotify/server / TestCloseClientOnNotReading

Function TestCloseClientOnNotReading

api/stream/stream_test.go:138–158  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

136}
137
138func TestCloseClientOnNotReading(t *testing.T) {
139 mode.Set(mode.TestDev)
140
141 server, api := bootTestServer(staticUserID())
142 defer server.Close()
143 defer api.Close()
144
145 wsURL := wsURL(server.URL)
146
147 ws, _, err := websocket.DefaultDialer.Dial(wsURL, nil)
148 assert.Nil(t, err)
149 defer ws.Close()
150
151 waitForConnectedClients(api, 1)
152
153 assert.NotEmpty(t, clients(api, 1))
154
155 time.Sleep(api.pingPeriod + api.pongTimeout)
156
157 assert.Empty(t, clients(api, 1))
158}
159
160func TestMessageDirectlyAfterConnect(t *testing.T) {
161 mode.Set(mode.Prod)

Callers

nothing calls this directly

Calls 7

SetFunction · 0.92
bootTestServerFunction · 0.85
staticUserIDFunction · 0.85
wsURLFunction · 0.85
waitForConnectedClientsFunction · 0.85
clientsFunction · 0.85
CloseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…