Files
Pulse/internal/monitoring/guest_filesystem_logger_test.go
pulse-triage[bot] b9409a0c74 Preserve measured zero guest memory and reliable guidance proofs
Keep explicit status/current zero availability through decoding and JSON copies so genuine exhaustion cannot become a healthy cache fallback. Connected direct/cluster collector controls cover canonical memory, History and breach/recovery. Complete race validation also exposed a shared-logger guidance fixture race: keep guidance on its caller logger with ordinary fallback, and stop the named scheduler-health fixture monitor. Message, backup precautions, command fences, thresholds and dependencies are unchanged; prior failed proof receipts remain retained.

Change-source: pulse-maintainer
2026-10-10 04:08:26 +01:00

23 lines
590 B
Go

package monitoring
import (
"bytes"
"context"
"testing"
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
)
func TestGuestFilesystemLoggerKeepsOrdinaryFallback(t *testing.T) {
if guestFilesystemLogger(context.Background()) != &log.Logger {
t.Fatal("ordinary filesystem guidance lost its process logger")
}
var output bytes.Buffer
logger := zerolog.New(&output)
ctx := logger.WithContext(context.Background())
if guestFilesystemLogger(ctx) != log.Ctx(ctx) || guestFilesystemLogger(ctx) == &log.Logger {
t.Fatal("filesystem guidance lost its explicit caller logger")
}
}