Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fmt
  • Loading branch information
Emyrk committed Jun 18, 2025
commit e640600223b206b792d4143be926d00b2318d3d8
8 changes: 4 additions & 4 deletions coderd/files/cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ func TestCacheRBAC(t *testing.T) {
require.NoError(t, err)
require.Equal(t, 1, cache.Count())

_ = a.Close()
_ = b.Close()
a.Close()
b.Close()
require.Equal(t, 0, cache.Count())

rec.AssertActorID(t, nobodyID.String(), rec.Pair(policy.ActionRead, file))
Expand Down Expand Up @@ -179,7 +179,7 @@ func TestRelease(t *testing.T) {
ids = append(ids, uuid.New())
}

releases := make(map[uuid.UUID][]func() error, 0)
releases := make(map[uuid.UUID][]func(), 0)
// Acquire a bunch of references
batchSize := 10
for openedIdx, id := range ids {
Expand Down Expand Up @@ -208,7 +208,7 @@ func TestRelease(t *testing.T) {
for closedIdx, id := range ids {
stillOpen := len(ids) - closedIdx
for closingIdx := range batchSize {
_ = releases[id][0]()
releases[id][0]()
releases[id] = releases[id][1:]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just change the loops to iterate over this releases map if you really wanna do it this way

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't feel like changing the test. This works


// Each time a file is released, the metrics should decrement the file refs
Expand Down
Loading