kvdb+etcd: enable channeldb testing with both bdb/etcd
This commit is contained in:
1 parent
3b7525659c
commit
248a00f211
7 files changed
+169
-40
No files matched your search
@@ -98,13 +98,22 @@ func makeTestDB() (*DB, func(), error) {
|
||||
}
|
||||
|
||||
// Next, create channeldb for the first time.
|
||||
cdb, err := Open(tempDirName, OptionClock(testClock))
|
||||
backend, backendCleanup, err := kvdb.GetTestBackend(tempDirName, "cdb")
|
||||
if err != nil {
|
||||
backendCleanup()
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
cdb, err := CreateWithBackend(backend, OptionClock(testClock))
|
||||
if err != nil {
|
||||
backendCleanup()
|
||||
os.RemoveAll(tempDirName)
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
cleanUp := func() {
|
||||
cdb.Close()
|
||||
backendCleanup()
|
||||
os.RemoveAll(tempDirName)
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user