Skip to content

Commit 8f440d1

Browse files
committed
Add unique dir for each BoltStore instance
1 parent 631c88a commit 8f440d1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

adapter/test_util.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"log"
66
"net"
77
"os"
8+
"path/filepath"
89
"strconv"
910
"sync"
1011
"sync/atomic"
@@ -18,6 +19,7 @@ import (
1819
pb "github.com/bootjp/elastickv/proto"
1920
"github.com/bootjp/elastickv/store"
2021
"github.com/cockroachdb/errors"
22+
"github.com/google/uuid"
2123
"github.com/hashicorp/go-hclog"
2224
"github.com/hashicorp/raft"
2325
"github.com/stretchr/testify/assert"
@@ -260,8 +262,8 @@ func setupNodes(t *testing.T, ctx context.Context, n int, ports []portsAdress, c
260262
var lc net.ListenConfig
261263

262264
for i := 0; i < n; i++ {
263-
264-
st, err := store.NewBoltStore(os.TempDir())
265+
rnd := uuid.New()
266+
st, err := store.NewBoltStore(filepath.Join(os.TempDir(), rnd.String(), "raft.db"))
265267
require.NoError(t, err)
266268
trxSt := store.NewMemoryStoreDefaultTTL()
267269
fsm := kv.NewKvFSM(st, trxSt)

0 commit comments

Comments
 (0)