diff --git a/dst/dst_test.go b/dst/dst_test.go index f7ec8bd7f4..c56902eaa5 100644 --- a/dst/dst_test.go +++ b/dst/dst_test.go @@ -338,7 +338,6 @@ func TestDST(t *testing.T) { }, walTicker, ) require.NoError(t, err) - defer c.Close() ctx := context.Background() var db atomic.Pointer[frostdb.DB] @@ -482,6 +481,10 @@ func TestDST(t *testing.T) { t.Log("snapshot files:", listFiles("snapshots")) t.Log("WAL files:", listFiles("wal")) + // Defer a close here. This is not done at the start of the test because + // the test run itself may close the store. + defer c.Close() + timestampSum := &int64checksum{} readTimestamps := make(map[int64]int) expectedTimestamps := make(map[int64]struct{})