diff options
author | VaiTon | 2023-04-29 18:17:01 +0000 |
---|---|---|
committer | VaiTon | 2023-04-29 18:17:01 +0000 |
commit | 195450507328055200337c1138cdaeaab47c18d5 (patch) | |
tree | 957b687ce013e3339d255fc093257a99ae1d1cc8 /caronte_test.go | |
parent | cb1ee4f3a9ff09b11c99fd802225594a35497110 (diff) |
Delete old pcaps to avoid infinite space consumption.
For the moment a const is used, namely MAX_PCAPS in pcap_importer.go.
It should, however, be then refactored to a runtime config.
Diffstat (limited to 'caronte_test.go')
-rw-r--r-- | caronte_test.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/caronte_test.go b/caronte_test.go index 8935ea3..0628e72 100644 --- a/caronte_test.go +++ b/caronte_test.go @@ -20,12 +20,13 @@ package main import ( "context" "fmt" - log "github.com/sirupsen/logrus" - "github.com/stretchr/testify/require" "os" "strconv" "testing" "time" + + log "github.com/sirupsen/logrus" + "github.com/stretchr/testify/require" ) type TestStorageWrapper struct { @@ -51,7 +52,8 @@ func NewTestStorageWrapper(t *testing.T) *TestStorageWrapper { storage, err := NewMongoStorage(mongoHost, port, dbName) require.NoError(t, err) - ctx, _ := context.WithTimeout(context.Background(), 10*time.Second) + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() return &TestStorageWrapper{ DbName: dbName, |