test: fix random "IsolationRead" fails (#14615)

Co-authored-by: pingcap-github-bot <sre-bot@pingcap.com>
This commit is contained in:
Zhuomin(Charming) Liu
2020-02-05 11:30:21 +08:00
committed by GitHub
parent 43b8e133e7
commit d7654e3c93
2 changed files with 4 additions and 6 deletions

View File

@ -264,16 +264,14 @@ func (s *testIntegrationSuite) TestNoneAccessPathsFoundByIsolationRead(c *C) {
_, err = tk.Exec("select * from t")
c.Assert(err, NotNil)
c.Assert(err.Error(), Equals, "[planner:1815]Internal : Can not find access path matching 'tidb_isolation_read_engines'(value: '[tikv tiflash tidb]') and tidb-server config isolation-read(engines: 'tiflash'). Available values are 'tikv'.")
c.Assert(err.Error(), Equals, "[planner:1815]Internal : Can not find access path matching 'tidb_isolation_read_engines'(value: 'tiflash') and tidb-server config isolation-read(engines: '[tikv tiflash tidb]'). Available values are 'tikv'.")
tk.MustExec("set @@session.tidb_isolation_read_engines = 'tikv, tiflash'")
config.GetGlobalConfig().IsolationRead.Engines = []string{"tiflash"}
defer func() {
config.GetGlobalConfig().IsolationRead.Engines = []string{"tikv", "tiflash", "tidb"}
}()
_, err = tk.Exec("select * from t")
config.GetGlobalConfig().IsolationRead.Engines = []string{"tikv", "tiflash", "tidb"}
c.Assert(err, NotNil)
c.Assert(err.Error(), Equals, "[planner:1815]Internal : Can not find access path matching 'tidb_isolation_read_engines'(value: '[tiflash]') and tidb-server config isolation-read(engines: 'tikv,tiflash'). Available values are 'tikv'.")
c.Assert(err.Error(), Equals, "[planner:1815]Internal : Can not find access path matching 'tidb_isolation_read_engines'(value: 'tikv,tiflash') and tidb-server config isolation-read(engines: '[tiflash]'). Available values are 'tikv'.")
}
func (s *testIntegrationSuite) TestSelPushDownTiFlash(c *C) {

View File

@ -756,7 +756,7 @@ func (b *PlanBuilder) filterPathByIsolationRead(paths []*util.AccessPath, dbName
engineVals, _ := b.ctx.GetSessionVars().GetSystemVar(variable.TiDBIsolationReadEngines)
err = ErrInternal.GenWithStackByArgs(fmt.Sprintf("Can not find access path matching '%v'(value: '%v') "+
"and tidb-server config isolation-read(engines: '%v'). Available values are '%v'.",
variable.TiDBIsolationReadEngines, config.GetGlobalConfig().IsolationRead.Engines, engineVals, availableEngineStr))
variable.TiDBIsolationReadEngines, engineVals, config.GetGlobalConfig().IsolationRead.Engines, availableEngineStr))
}
return paths, err
}