MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / TestStatsLoggerStopped

Function TestStatsLoggerStopped

rest/server_context_test.go:254–272  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

252}
253
254func TestStatsLoggerStopped(t *testing.T) {
255 base.SetUpTestLogging(t, base.LevelDebug, base.KeyAll)
256
257 sc := DefaultStartupConfig("")
258
259 // Start up stats logger by creating server context
260 ctx := base.TestCtx(t)
261 svrctx := NewServerContext(ctx, &sc, false)
262
263 // Close server context which will send signal to close stats logger
264 svrctx.Close(ctx)
265
266 // ensure stats terminator is closed
267 _, ok := <-svrctx.statsContext.terminator
268 assert.False(t, ok)
269
270 // sleep a bit to allow the "Stopping stats logging goroutine" debug logging to be printed
271 time.Sleep(time.Millisecond * 10)
272}
273
274func TestObtainManagementEndpointsFromServerContext(t *testing.T) {
275 if base.UnitTestUrlIsWalrus() {

Callers

nothing calls this directly

Calls 5

CloseMethod · 0.95
SetUpTestLoggingFunction · 0.92
TestCtxFunction · 0.92
DefaultStartupConfigFunction · 0.85
NewServerContextFunction · 0.85

Tested by

no test coverage detected