Skip to content

Commit

Permalink
test: Fix too many files open error on MacOS (#4727)
Browse files Browse the repository at this point in the history
Signed-off-by: Anders Eknert <anders@eknert.com>
  • Loading branch information
anderseknert committed Jun 1, 2022
1 parent 35f4523 commit 0502529
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions server/server_test.go
Expand Up @@ -1001,6 +1001,7 @@ func TestCompileV1Observability(t *testing.T) {
if err != nil {
t.Fatal(err)
}
defer disk.Close(ctx)
f := newFixtureWithStore(t, disk)

err = f.v1(http.MethodPut, "/policies/test", `package test
Expand Down Expand Up @@ -1579,6 +1580,7 @@ p = true { false }`
if err != nil {
t.Fatal(err)
}
defer disk.Close(ctx)
executeRequests(t, tc.reqs,
variant{"inmem", nil},
variant{"disk", []func(*Server){
Expand All @@ -1600,6 +1602,7 @@ func TestDataV1Metrics(t *testing.T) {
if err != nil {
t.Fatal(err)
}
defer disk.Close(ctx)

f := newFixtureWithStore(t, disk)
put := newReqV1(http.MethodPut, `/data?metrics`, `{"foo":"bar"}`)
Expand Down Expand Up @@ -1765,6 +1768,7 @@ func TestBundleScope(t *testing.T) {
if err != nil {
t.Fatal(err)
}
defer disk.Close(ctx)

for _, v := range []variant{
{"inmem", nil},
Expand Down Expand Up @@ -2406,6 +2410,7 @@ func TestDataMetricsEval(t *testing.T) {
if err != nil {
t.Fatal(err)
}
defer disk.Close(ctx)

f := newFixtureWithStore(t, disk)

Expand Down Expand Up @@ -3266,6 +3271,7 @@ func TestQueryV1(t *testing.T) {
if err != nil {
t.Fatal(err)
}
defer disk.Close(ctx)

f := newFixtureWithStore(t, disk)
get := newReqV1(http.MethodGet, `/query?q=a=[1,2,3]%3Ba[i]=x&metrics`, "")
Expand Down

0 comments on commit 0502529

Please sign in to comment.