Skip to content

Commit

Permalink
update cleanup in node_live_test.go too
Browse files Browse the repository at this point in the history
  • Loading branch information
jchappelow committed Dec 6, 2024
1 parent 982641d commit c177e59
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions node/node_live_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ var defaultGenesisParams = &consensus.GenesisParams{
},
}

func TestMain(m *testing.M) {
pg.UseLogger(log.New(log.WithName("DBS")))
m.Run()
}

func TestSingleNodeMocknet(t *testing.T) {
if testing.Short() {
t.Skip()
Expand All @@ -54,8 +59,6 @@ func TestSingleNodeMocknet(t *testing.T) {
bs1 := memstore.NewMemBS()
mp1 := mempool.New()

pg.UseLogger(log.New(log.WithName("DBS")))

db1 := initDB(t, "5432", "kwil_test_db")

root1 := t.TempDir()
Expand Down Expand Up @@ -155,8 +158,6 @@ func TestDualNodeMocknet(t *testing.T) {
bs1 := memstore.NewMemBS()
mp1 := mempool.New()

pg.UseLogger(log.New(log.WithName("DBS")))

db1 := initDB(t, "5432", "kwil_test_db")
func() {
ctx := context.Background()
Expand Down Expand Up @@ -332,10 +333,9 @@ func initDB(t *testing.T, port, dbName string) *pg.DB {
}

func cleanupDB(db *pg.DB) {
ctx := context.Background()
db.AutoCommit(true)
defer db.AutoCommit(false)
defer db.Close()
db.AutoCommit(true)
ctx := context.Background()
db.Execute(ctx, `DROP SCHEMA IF EXISTS kwild_chain CASCADE;`)
db.Execute(ctx, `DROP SCHEMA IF EXISTS kwild_internal CASCADE;`)
}
Expand Down

0 comments on commit c177e59

Please sign in to comment.