Skip to content

Commit

Permalink
fix: initialize socketPath to prevent stale cache (#491)
Browse files Browse the repository at this point in the history
`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.
  • Loading branch information
holmanb authored Aug 21, 2024
1 parent 0dd6abc commit 9c9e95a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions internals/daemon/daemon_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 9c9e95a

Please sign in to comment.