MM-27149: optimize initBasic (#15063)
* MM-27149: optimize initBasic Mostly, all tests just needed the user initialization part and not the channel and group creation. So we move the user initialization inside the Setup call. This avoids unnecessary DB calls which take around 250-300ms on average. And we make the login requests concurrently to shave off a few more ms. According to my tests, the 2 login calls take 140 ms on average, which shaves off 70ms. So approximately, we shave off 350ms per test. And there are 114 occurences of these. So around 39 seconds. * make initlogin only for Setup/SetupEnterprise Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
30bd506e76
Коммит
4a2715974d
@@ -12,7 +12,7 @@ import (
|
||||
)
|
||||
|
||||
func TestCreateJob(t *testing.T) {
|
||||
th := Setup(t).InitBasic()
|
||||
th := Setup(t)
|
||||
defer th.TearDown()
|
||||
|
||||
job := &model.Job{
|
||||
@@ -39,7 +39,7 @@ func TestCreateJob(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestGetJob(t *testing.T) {
|
||||
th := Setup(t).InitBasic()
|
||||
th := Setup(t)
|
||||
defer th.TearDown()
|
||||
|
||||
job := &model.Job{
|
||||
@@ -68,7 +68,7 @@ func TestGetJob(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestGetJobs(t *testing.T) {
|
||||
th := Setup(t).InitBasic()
|
||||
th := Setup(t)
|
||||
defer th.TearDown()
|
||||
|
||||
jobType := model.NewId()
|
||||
@@ -115,7 +115,7 @@ func TestGetJobs(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestGetJobsByType(t *testing.T) {
|
||||
th := Setup(t).InitBasic()
|
||||
th := Setup(t)
|
||||
defer th.TearDown()
|
||||
|
||||
jobType := model.NewId()
|
||||
@@ -173,7 +173,7 @@ func TestGetJobsByType(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestCancelJob(t *testing.T) {
|
||||
th := Setup(t).InitBasic()
|
||||
th := Setup(t)
|
||||
defer th.TearDown()
|
||||
|
||||
jobs := []*model.Job{
|
||||
|
||||
Ссылка в новой задаче
Block a user