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

Function TestLogFlush

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

Source from the content-addressed store, hash-verified

618}
619
620func TestLogFlush(t *testing.T) {
621 // FIXME: CBG-1869 flaky test
622 t.Skip("CBG-1869: Flaky test")
623
624 testCases := []struct {
625 Name string
626 ExpectedLogFileCount int
627 EnableFunc func(config StartupConfig) StartupConfig
628 }{
629 {
630 "Default",
631 4,
632 func(config StartupConfig) StartupConfig {
633 return config
634 },
635 },
636 {
637 "Add trace",
638 5,
639 func(config StartupConfig) StartupConfig {
640 config.Logging.Trace = &base.FileLoggerConfig{
641 Enabled: base.Ptr(true),
642 }
643 return config
644 },
645 },
646 {
647 "Add debug and trace",
648 6,
649 func(config StartupConfig) StartupConfig {
650 config.Logging.Debug = &base.FileLoggerConfig{
651 Enabled: base.Ptr(true),
652 }
653 config.Logging.Trace = &base.FileLoggerConfig{
654 Enabled: base.Ptr(true),
655 }
656 return config
657 },
658 },
659 {
660 "Disable error",
661 3,
662 func(config StartupConfig) StartupConfig {
663 config.Logging.Error = &base.FileLoggerConfig{
664 Enabled: base.Ptr(false),
665 }
666 return config
667 },
668 },
669 }
670
671 for _, testCase := range testCases {
672 t.Run(testCase.Name, func(t *testing.T) {
673 base.SetUpTestLogging(t, base.LevelInfo, base.KeyAll)
674
675 // Setup memory logging
676 base.InitializeMemoryLoggers()
677

Callers

nothing calls this directly

Calls 15

PtrFunction · 0.92
SetUpTestLoggingFunction · 0.92
InitializeMemoryLoggersFunction · 0.92
TestCtxFunction · 0.92
ErrorfCtxFunction · 0.92
WarnfCtxFunction · 0.92
InfofCtxFunction · 0.92
DebugfCtxFunction · 0.92
TracefCtxFunction · 0.92
RecordStatsFunction · 0.92
FlushLoggerBuffersFunction · 0.92
FlushLogBuffersFunction · 0.92

Tested by

no test coverage detected