Skip to content
Closed
Changes from all commits
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
7 changes: 1 addition & 6 deletions p2p/host/peerstore/pstoreds/ds_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package pstoreds

import (
"context"
"os"
"testing"
"time"

Expand Down Expand Up @@ -104,17 +103,13 @@ func BenchmarkDsPeerstore(b *testing.B) {
//
//lint:ignore U1000 disabled for now
func badgerStore(tb testing.TB) (ds.Batching, func()) {
dataPath, err := os.MkdirTemp(os.TempDir(), "badger")
if err != nil {
tb.Fatal(err)
}
dataPath := tb.TempDir()
store, err := badger.NewDatastore(dataPath, nil)
if err != nil {
tb.Fatal(err)
}
closer := func() {
store.Close()
os.RemoveAll(dataPath)
}
return store, closer
}
Expand Down