Skip to content

Commit 12f91e2

Browse files
committed
linting
1 parent f4f849b commit 12f91e2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

coderd/files/cache_internal_test.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
"golang.org/x/sync/errgroup"
1414

1515
"github.com/coder/coder/v2/coderd/coderdtest/promhelp"
16+
"github.com/coder/coder/v2/coderd/database/dbauthz"
1617
"github.com/coder/coder/v2/coderd/rbac"
1718
"github.com/coder/coder/v2/coderd/rbac/policy"
1819
"github.com/coder/coder/v2/testutil"
@@ -28,6 +29,7 @@ func cachePromMetricName(metric string) string {
2829

2930
func TestConcurrency(t *testing.T) {
3031
t.Parallel()
32+
ctx := dbauthz.AsFileReader(t.Context())
3133

3234
const fileSize = 10
3335
emptyFS := afero.NewIOFS(afero.NewReadOnlyFs(afero.NewMemMapFs()))
@@ -57,7 +59,7 @@ func TestConcurrency(t *testing.T) {
5759
g.Go(func() error {
5860
// We don't bother to Release these references because the Cache will be
5961
// released at the end of the test anyway.
60-
_, err := c.Acquire(t.Context(), id)
62+
_, err := c.Acquire(ctx, id)
6163
return err
6264
})
6365
}
@@ -80,6 +82,7 @@ func TestConcurrency(t *testing.T) {
8082

8183
func TestRelease(t *testing.T) {
8284
t.Parallel()
85+
ctx := dbauthz.AsFileReader(t.Context())
8386

8487
const fileSize = 10
8588
emptyFS := afero.NewIOFS(afero.NewReadOnlyFs(afero.NewMemMapFs()))
@@ -101,7 +104,7 @@ func TestRelease(t *testing.T) {
101104
batchSize := 10
102105
for openedIdx, id := range ids {
103106
for batchIdx := range batchSize {
104-
it, err := c.Acquire(t.Context(), id)
107+
it, err := c.Acquire(ctx, id)
105108
require.NoError(t, err)
106109
require.Equal(t, emptyFS, it)
107110

0 commit comments

Comments
 (0)