From 9c9e95a020ead1662712ea7ea63ece0920f9596f Mon Sep 17 00:00:00 2001 From: Brett Holman Date: Wed, 21 Aug 2024 16:15:07 -0600 Subject: [PATCH] fix: initialize socketPath to prevent stale cache (#491) `daemonSuite.socketPath` appears to be assigned outside of the test, but only when it has a default value, which results in a stale `socketPath` value in this test. Running `go test -count=2 -v ./internals/daemon -check.v` with this fix now passes. Fixes #282. --- internals/daemon/daemon_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internals/daemon/daemon_test.go b/internals/daemon/daemon_test.go index e4f63a00..6751ead9 100644 --- a/internals/daemon/daemon_test.go +++ b/internals/daemon/daemon_test.go @@ -69,6 +69,7 @@ func (s *daemonSuite) SetUpTest(c *C) { c.Fatalf("cannot start reaper: %v", err) } + s.socketPath = "" s.pebbleDir = c.MkDir() s.statePath = filepath.Join(s.pebbleDir, cmd.StateFile) systemdSdNotify = func(notif string) error {