MCPcopy Index your code
hub / github.com/cloudflare/cloudflared / TestSession_ActiveControl

Function TestSession_ActiveControl

management/session_test.go:13–23  ·  view source on GitHub ↗

Validate the active states of the session

(t *testing.T)

Source from the content-addressed store, hash-verified

11
12// Validate the active states of the session
13func TestSession_ActiveControl(t *testing.T) {
14 _, cancel := context.WithCancel(context.Background())
15 defer cancel()
16 session := newSession(4, actor{}, cancel)
17 // session starts out not active
18 assert.False(t, session.Active())
19 session.active.Store(true)
20 assert.True(t, session.Active())
21 session.Stop()
22 assert.False(t, session.Active())
23}
24
25// Validate that the session filters events
26func TestSession_Insert(t *testing.T) {

Callers

nothing calls this directly

Calls 3

newSessionFunction · 0.85
ActiveMethod · 0.80
StopMethod · 0.45

Tested by

no test coverage detected