Skip to content

Commit

Permalink
fix ut
Browse files Browse the repository at this point in the history
  • Loading branch information
xuyifangreeneyes committed Feb 2, 2023
1 parent 9a34556 commit 047e03d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions statistics/handle/handle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -553,10 +553,10 @@ func TestReloadExtStatsLockRelease(t *testing.T) {
tk.MustExec("insert into t values(1,1),(2,2),(3,3)")
tk.MustExec("alter table t add stats_extended s1 correlation(a,b)")
tk.MustExec("analyze table t")
require.NoError(t, failpoint.Enable("github.com/pingcap/tidb/statistics/handle/injectExtStatsLoadErr", `return("")`))
require.NoError(t, failpoint.Enable("github.com/pingcap/tidb/statistics/injectExtStatsLoadErr", `return("")`))
err := tk.ExecToErr("admin reload stats_extended")
require.Equal(t, "gofail extendedStatsFromStorage error", err.Error())
require.NoError(t, failpoint.Disable("github.com/pingcap/tidb/statistics/handle/injectExtStatsLoadErr"))
require.NoError(t, failpoint.Disable("github.com/pingcap/tidb/statistics/injectExtStatsLoadErr"))
// Check the lock is released by `admin reload stats_extended` if error happens.
tk.MustExec("analyze table t")
}
Expand Down

0 comments on commit 047e03d

Please sign in to comment.