Replace remaining GetMaster() queries (#19545)

There are still some remaining which
access the raw DB struct. There will be
a separate PR to clean those up.

```release-note
NONE
```
Этот коммит содержится в:
Agniva De Sarker
2022-02-16 22:30:27 +05:30
коммит произвёл GitHub
родитель 256427f7f9
Коммит 678c7d3b8c
26 изменённых файлов: 178 добавлений и 518 удалений

Просмотреть файл

@@ -90,7 +90,7 @@ func StoreTestWithSqlStore(t *testing.T, f func(*testing.T, store.Store, storete
if testing.Short() {
t.SkipNow()
}
f(t, st.Store, st.SqlStore)
f(t, st.Store, &StoreTestWrapper{st.SqlStore})
})
}
}
@@ -760,7 +760,7 @@ func TestExecNoTimeout(t *testing.T) {
} else if sqlStore.DriverName() == model.DatabaseDriverPostgres {
query = `SELECT pg_sleep(2);`
}
_, err := sqlStore.GetMaster().ExecNoTimeout(query)
_, err := sqlStore.GetMasterX().ExecNoTimeout(query)
require.NoError(t, err)
})
}
@@ -781,6 +781,6 @@ func TestMySQLReadTimeout(t *testing.T) {
store.initConnection()
defer store.Close()
_, err = store.GetMaster().ExecNoTimeout(`SELECT SLEEP(3)`)
_, err = store.GetMasterX().ExecNoTimeout(`SELECT SLEEP(3)`)
require.NoError(t, err)
}