waddrmgr: update tests to use db timeout param
This commit is contained in:
parent
08308c81ed
commit
f6ea9d4d7b
2 changed files with 7 additions and 3 deletions
|
@ -200,6 +200,10 @@ var (
|
||||||
// expectedInternalAddrs is the list of expected internal addresses
|
// expectedInternalAddrs is the list of expected internal addresses
|
||||||
// generated from the seed
|
// generated from the seed
|
||||||
expectedInternalAddrs = expectedAddrs[5:]
|
expectedInternalAddrs = expectedAddrs[5:]
|
||||||
|
|
||||||
|
// defaultDBTimeout specifies the timeout value when opening the wallet
|
||||||
|
// database.
|
||||||
|
defaultDBTimeout = 10 * time.Second
|
||||||
)
|
)
|
||||||
|
|
||||||
// checkManagerError ensures the passed error is a ManagerError with an error
|
// checkManagerError ensures the passed error is a ManagerError with an error
|
||||||
|
@ -238,7 +242,7 @@ func emptyDB(t *testing.T) (tearDownFunc func(), db walletdb.DB) {
|
||||||
t.Fatalf("Failed to create db temp dir: %v", err)
|
t.Fatalf("Failed to create db temp dir: %v", err)
|
||||||
}
|
}
|
||||||
dbPath := filepath.Join(dirName, "mgrtest.db")
|
dbPath := filepath.Join(dirName, "mgrtest.db")
|
||||||
db, err = walletdb.Create("bdb", dbPath, true)
|
db, err = walletdb.Create("bdb", dbPath, true, defaultDBTimeout)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
_ = os.RemoveAll(dirName)
|
_ = os.RemoveAll(dirName)
|
||||||
t.Fatalf("createDbNamespace: unexpected error: %v", err)
|
t.Fatalf("createDbNamespace: unexpected error: %v", err)
|
||||||
|
@ -259,7 +263,7 @@ func setupManager(t *testing.T) (tearDownFunc func(), db walletdb.DB, mgr *Manag
|
||||||
t.Fatalf("Failed to create db temp dir: %v", err)
|
t.Fatalf("Failed to create db temp dir: %v", err)
|
||||||
}
|
}
|
||||||
dbPath := filepath.Join(dirName, "mgrtest.db")
|
dbPath := filepath.Join(dirName, "mgrtest.db")
|
||||||
db, err = walletdb.Create("bdb", dbPath, true)
|
db, err = walletdb.Create("bdb", dbPath, true, defaultDBTimeout)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
_ = os.RemoveAll(dirName)
|
_ = os.RemoveAll(dirName)
|
||||||
t.Fatalf("createDbNamespace: unexpected error: %v", err)
|
t.Fatalf("createDbNamespace: unexpected error: %v", err)
|
||||||
|
|
|
@ -1683,7 +1683,7 @@ func testConvertWatchingOnly(tc *testContext) bool {
|
||||||
defer os.Remove(woMgrName)
|
defer os.Remove(woMgrName)
|
||||||
|
|
||||||
// Open the new database copy and get the address manager namespace.
|
// Open the new database copy and get the address manager namespace.
|
||||||
db, err := walletdb.Open("bdb", woMgrName, true)
|
db, err := walletdb.Open("bdb", woMgrName, true, defaultDBTimeout)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
tc.t.Errorf("openDbNamespace: unexpected error: %v", err)
|
tc.t.Errorf("openDbNamespace: unexpected error: %v", err)
|
||||||
return false
|
return false
|
||||||
|
|
Loading…
Reference in a new issue