diff options
| author | historia <[not public]> | 2026-10-05 18:16:47 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-10-05 18:16:47 -0400 |
| commit | 9d8c43cd68c960b9a6b8f781684f763e204a4498 (patch) | |
| tree | c9e2a02094a8700db29db2768a0d058ce259a4f4 /internal/game | |
| parent | 7a15a5d70004b28bf2a710fa0f536af2446e5b17 (diff) | |
| download | thehouseoficarus-9d8c43cd68c960b9a6b8f781684f763e204a4498.tar.gz | |
fix: shared YAML encoder and journal directory, text cleanup
Diffstat (limited to 'internal/game')
| -rw-r--r-- | internal/game/account_txn.go | 3 | ||||
| -rw-r--r-- | internal/game/harness_test.go | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/internal/game/account_txn.go b/internal/game/account_txn.go index 6e1e2d1..a1a5cf0 100644 --- a/internal/game/account_txn.go +++ b/internal/game/account_txn.go @@ -6,7 +6,6 @@ import ( "fmt" "log" "os" - "path/filepath" "strings" "thehouseoficarus/internal/net" @@ -25,7 +24,7 @@ import ( // journalDir is the persistence journal directory under the game data dir. func (g *Game) journalDir() string { - return filepath.Join(g.DataDir, ".journal") + return persistence.JournalDir(g.DataDir) } // newTxn starts a lifecycle transaction. diff --git a/internal/game/harness_test.go b/internal/game/harness_test.go index ff5ac32..3bdce0f 100644 --- a/internal/game/harness_test.go +++ b/internal/game/harness_test.go @@ -123,6 +123,10 @@ func newHarness(t *testing.T) *harness { conns: make(map[string]*chanConn), } h.stop = func() { close(stopTick); <-done } + // Stop the Game's owner goroutine too, or every harness test leaks one + // (each holding a 4096-slot channel) for the life of the test binary. + // Cleanup is LIFO, so the ticker stops first, then the owner. + t.Cleanup(g.stopOwner) t.Cleanup(h.stop) return h } |
