close db connections in test flush helpers

Previously, database connections would stay alive until "go test"
would finish, sometimes leading to max conn errors.
This commit is contained in:
ionutboangiu
2025-05-26 18:56:58 +03:00
committed by Dan Christian Bogos
parent 43cdd396ba
commit 5f47df6927
5 changed files with 16 additions and 96 deletions

View File

@@ -118,21 +118,7 @@ func testSessionSBkupInitCfg(t *testing.T) {
// Remove data in both rating and accounting db
func testSessionSBkupResetDB(t *testing.T) {
if *utils.DBType == utils.MetaInternal {
if err := engine.PreInitDataDb(sBkupCfg); err != nil {
t.Fatal(err)
}
if err := engine.PreInitStorDb(sBkupCfg); err != nil {
t.Fatal(err)
}
} else {
if err := engine.InitDataDb(sBkupCfg); err != nil {
t.Fatal(err)
}
if err := engine.InitStorDb(sBkupCfg); err != nil {
t.Fatal(err)
}
}
engine.FlushDBs(t, sBkupCfg, true, true)
}
// Start CGR Engine