mvcc/backend tests: Refactor: Do not mix testing&prod code.

This commit is contained in:
Piotr Tabor
2021-04-09 15:49:50 +02:00
parent ea287dd9f8
commit d7d110b5a8
20 changed files with 257 additions and 196 deletions

View File

@@ -23,7 +23,7 @@ import (
"go.etcd.io/etcd/pkg/v3/traceutil"
"go.etcd.io/etcd/server/v3/lease"
"go.etcd.io/etcd/server/v3/mvcc/backend"
betesting "go.etcd.io/etcd/server/v3/mvcc/backend/testing"
"go.uber.org/zap"
)
@@ -66,7 +66,7 @@ func TestScheduleCompaction(t *testing.T) {
},
}
for i, tt := range tests {
b, tmpPath := backend.NewDefaultTmpBackend(t)
b, tmpPath := betesting.NewDefaultTmpBackend(t)
s := NewStore(zap.NewExample(), b, &lease.FakeLessor{}, nil, StoreConfig{})
tx := s.b.BatchTx()
@@ -100,7 +100,7 @@ func TestScheduleCompaction(t *testing.T) {
}
func TestCompactAllAndRestore(t *testing.T) {
b, tmpPath := backend.NewDefaultTmpBackend(t)
b, tmpPath := betesting.NewDefaultTmpBackend(t)
s0 := NewStore(zap.NewExample(), b, &lease.FakeLessor{}, nil, StoreConfig{})
defer os.Remove(tmpPath)