Skip to content

Commit

Permalink
[tests]: call Close() to cleanup temporary directory (#2651)
Browse files Browse the repository at this point in the history
Signed-off-by: Li Zhijian <[email protected]>
  • Loading branch information
zhijianli88 authored Nov 26, 2020
1 parent 57b4ea2 commit b8ccf73
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions plugin/storage/badger/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ func TestMaintenanceCodecov(t *testing.T) {
f.InitFromViper(v)
mFactory := metricstest.NewFactory(0)
f.Initialize(mFactory, zap.NewNop())
defer f.Close()

waiter := func() {
for sleeps := 0; sleeps < 8; sleeps++ {
Expand Down
1 change: 1 addition & 0 deletions plugin/storage/badger/stats_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ func TestDiskStatisticsUpdate(t *testing.T) {
mFactory := metricstest.NewFactory(0)
err := f.Initialize(mFactory, zap.NewNop())
assert.NoError(t, err)
defer f.Close()

err = f.diskStatisticsUpdate()
assert.NoError(t, err)
Expand Down
1 change: 1 addition & 0 deletions plugin/storage/badger/stats_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ func TestDiskStatisticsUpdate(t *testing.T) {
f.InitFromViper(v)
err := f.Initialize(metrics.NullFactory, zap.NewNop())
assert.NoError(t, err)
defer f.Close()

// We're not expecting any value in !linux, just no error
err = f.diskStatisticsUpdate()
Expand Down

0 comments on commit b8ccf73

Please sign in to comment.