[MM-35767] Ignore readTimeout param from MySQL datasource (#17624)
* Ignore readTimeout from MySQL datasource * Add TODO Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
ec78dcaf6e
Коммит
09f99e2426
@@ -9,6 +9,7 @@ import (
|
||||
"regexp"
|
||||
"sync"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/go-sql-driver/mysql"
|
||||
"github.com/lib/pq"
|
||||
@@ -674,3 +675,23 @@ func TestExecNoTimeout(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
})
|
||||
}
|
||||
|
||||
func TestMySQLReadTimeout(t *testing.T) {
|
||||
settings := makeSqlSettings(model.DATABASE_DRIVER_MYSQL)
|
||||
dataSource := *settings.DataSource
|
||||
config, err := mysql.ParseDSN(dataSource)
|
||||
require.NoError(t, err)
|
||||
|
||||
config.ReadTimeout = 1 * time.Second
|
||||
dataSource = config.FormatDSN()
|
||||
settings.DataSource = &dataSource
|
||||
|
||||
store := &SqlStore{
|
||||
settings: settings,
|
||||
}
|
||||
store.initConnection()
|
||||
defer store.Close()
|
||||
|
||||
_, err = store.GetMaster().ExecNoTimeout(`SELECT SLEEP(3)`)
|
||||
require.NoError(t, err)
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user