Skip to content

Commit

Permalink
executor: fix TestSortSpillDisk in ut (#48402)
Browse files Browse the repository at this point in the history
close #48401
  • Loading branch information
xzhangxian1008 authored Nov 8, 2023
1 parent 5fdd857 commit 89ec3d3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions pkg/executor/cte_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ func TestSpillToDisk(t *testing.T) {
require.NoError(t, failpoint.Disable("github.com/pingcap/tidb/pkg/executor/testCTEStorageSpill"))
tk.MustExec("set tidb_mem_quota_query = 1073741824;")
}()
require.NoError(t, failpoint.Enable("github.com/pingcap/tidb/pkg/executor/testSortedRowContainerSpill", "return(true)"))
require.NoError(t, failpoint.Enable("github.com/pingcap/tidb/pkg/executor/sortexec/testSortedRowContainerSpill", "return(true)"))
defer func() {
require.NoError(t, failpoint.Disable("github.com/pingcap/tidb/pkg/executor/testSortedRowContainerSpill"))
require.NoError(t, failpoint.Disable("github.com/pingcap/tidb/pkg/executor/sortexec/testSortedRowContainerSpill"))
}()

// Use duplicated rows to test UNION DISTINCT.
Expand Down
4 changes: 2 additions & 2 deletions pkg/executor/executor_pkg_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,9 +272,9 @@ func TestFilterTemporaryTableKeys(t *testing.T) {
}

func TestSortSpillDisk(t *testing.T) {
require.NoError(t, failpoint.Enable("github.com/pingcap/tidb/pkg/executor/testSortedRowContainerSpill", "return(true)"))
require.NoError(t, failpoint.Enable("github.com/pingcap/tidb/pkg/executor/sortexec/testSortedRowContainerSpill", "return(true)"))
defer func() {
require.NoError(t, failpoint.Disable("github.com/pingcap/tidb/pkg/executor/testSortedRowContainerSpill"))
require.NoError(t, failpoint.Disable("github.com/pingcap/tidb/pkg/executor/sortexec/testSortedRowContainerSpill"))
}()
ctx := mock.NewContext()
ctx.GetSessionVars().MemQuota.MemQuotaQuery = 1
Expand Down
8 changes: 4 additions & 4 deletions pkg/executor/sortexec/sort_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ func testSortInDisk(t *testing.T, removeDir bool) {
conf.TempStoragePath = t.TempDir()
conf.Performance.EnableStatsCacheMemQuota = true
})
require.NoError(t, failpoint.Enable("github.com/pingcap/tidb/pkg/executor/testSortedRowContainerSpill", "return(true)"))
require.NoError(t, failpoint.Enable("github.com/pingcap/tidb/pkg/executor/sortexec/testSortedRowContainerSpill", "return(true)"))
defer func() {
require.NoError(t, failpoint.Disable("github.com/pingcap/tidb/pkg/executor/testSortedRowContainerSpill"))
require.NoError(t, failpoint.Disable("github.com/pingcap/tidb/pkg/executor/sortexec/testSortedRowContainerSpill"))
}()
store, dom := testkit.CreateMockStoreAndDomain(t)
tk := testkit.NewTestKit(t, store)
Expand Down Expand Up @@ -104,8 +104,8 @@ func TestIssue16696(t *testing.T) {
variable.MemoryUsageAlarmRatio.Store(0.0)
defer variable.MemoryUsageAlarmRatio.Store(alarmRatio)

require.NoError(t, failpoint.Enable("github.com/pingcap/tidb/pkg/executor/testSortedRowContainerSpill", "return(true)"))
defer require.NoError(t, failpoint.Disable("github.com/pingcap/tidb/pkg/executor/testSortedRowContainerSpill"))
require.NoError(t, failpoint.Enable("github.com/pingcap/tidb/pkg/executor/sortexec/testSortedRowContainerSpill", "return(true)"))
defer require.NoError(t, failpoint.Disable("github.com/pingcap/tidb/pkg/executor/sortexec/testSortedRowContainerSpill"))
require.NoError(t, failpoint.Enable("github.com/pingcap/tidb/pkg/executor/testRowContainerSpill", "return(true)"))
defer require.NoError(t, failpoint.Disable("github.com/pingcap/tidb/pkg/executor/testRowContainerSpill"))
store := testkit.CreateMockStore(t)
Expand Down

0 comments on commit 89ec3d3

Please sign in to comment.