Merge pull request #522 from halseth/test-race-condition
waddrmgr test: fix test race condition
This commit is contained in:
commit
eb5aba63a6
2 changed files with 4 additions and 2 deletions
|
@ -206,8 +206,6 @@ func emptyDB(t *testing.T) (tearDownFunc func(), db walletdb.DB) {
|
|||
// setupManager creates a new address manager and returns a teardown function
|
||||
// that should be invoked to ensure it is closed and removed upon completion.
|
||||
func setupManager(t *testing.T) (tearDownFunc func(), db walletdb.DB, mgr *waddrmgr.Manager) {
|
||||
t.Parallel()
|
||||
|
||||
// Create a new manager in a temp directory.
|
||||
dirName, err := ioutil.TempDir("", "mgrtest")
|
||||
if err != nil {
|
||||
|
|
|
@ -1859,6 +1859,8 @@ func TestManager(t *testing.T) {
|
|||
// TestEncryptDecryptErrors ensures that errors which occur while encrypting and
|
||||
// decrypting data return the expected errors.
|
||||
func TestEncryptDecryptErrors(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
teardown, db, mgr := setupManager(t)
|
||||
defer teardown()
|
||||
|
||||
|
@ -1911,6 +1913,8 @@ func TestEncryptDecryptErrors(t *testing.T) {
|
|||
// TestEncryptDecrypt ensures that encrypting and decrypting data with the
|
||||
// the various crypto key types works as expected.
|
||||
func TestEncryptDecrypt(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
teardown, db, mgr := setupManager(t)
|
||||
defer teardown()
|
||||
|
||||
|
|
Loading…
Reference in a new issue