Skip to content

Commit

Permalink
dst: close most recent ColumnStore instead of first on defer
Browse files Browse the repository at this point in the history
We were closing the incorrect column store at the end of the test (in some
cases double closing).
  • Loading branch information
asubiotto committed May 21, 2024
1 parent b664392 commit cbb3e63
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion dst/dst_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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{})
Expand Down

0 comments on commit cbb3e63

Please sign in to comment.