database: Separate dbs for concurrent db tests.

This updates v2 test database names to avoid conflicts when multiple
database modules are being tested
This commit is contained in:
Donald Adu-Poku 2019-08-08 13:39:50 +00:00 committed by Dave Collins
parent 1149d54cb9
commit 09f823b422
2 changed files with 4 additions and 4 deletions

View File

@ -31,7 +31,7 @@ func ExampleCreate() {
// Typically you wouldn't want to remove the database right away like
// this, nor put it in the temp directory, but it's done here to ensure
// the example cleans up after itself.
dbPath := filepath.Join(os.TempDir(), "examplecreate")
dbPath := filepath.Join(os.TempDir(), "examplecreate-v2")
db, err := database.Create("ffldb", dbPath, wire.MainNet)
if err != nil {
fmt.Println(err)
@ -57,7 +57,7 @@ func Example_basicUsage() {
// Typically you wouldn't want to remove the database right away like
// this, nor put it in the temp directory, but it's done here to ensure
// the example cleans up after itself.
dbPath := filepath.Join(os.TempDir(), "exampleusage")
dbPath := filepath.Join(os.TempDir(), "exampleusage-v2")
db, err := database.Create("ffldb", dbPath, wire.MainNet)
if err != nil {
fmt.Println(err)
@ -123,7 +123,7 @@ func Example_blockStorageAndRetrieval() {
// Typically you wouldn't want to remove the database right away like
// this, nor put it in the temp directory, but it's done here to ensure
// the example cleans up after itself.
dbPath := filepath.Join(os.TempDir(), "exampleblkstorage")
dbPath := filepath.Join(os.TempDir(), "exampleblkstorage-v2")
db, err := database.Create("ffldb", dbPath, wire.MainNet)
if err != nil {
fmt.Println(err)

View File

@ -103,7 +103,7 @@ func TestCreateOpenFail(t *testing.T) {
// Ensure operations against a closed database return the expected
// error.
dbPath := filepath.Join(os.TempDir(), "ffldb-createfail")
dbPath := filepath.Join(os.TempDir(), "ffldb-createfail-v2")
_ = os.RemoveAll(dbPath)
db, err := database.Create(dbType, dbPath, blockDataNet)
if err != nil {