Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
wshwsh12 committed Apr 20, 2022
1 parent a96b40e commit a3c49bb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions util/chunk/row_container_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,14 +156,14 @@ func TestSortedRowContainerSortSpillAction(t *testing.T) {
var tracker *memory.Tracker
var err error
tracker = rc.GetMemTracker()
tracker.SetBytesLimit(chk.MemoryUsage() + 1)
tracker.SetBytesLimit(chk.MemoryUsage() + int64(8*chk.NumRows()) + 1)
tracker.FallbackOldAndSetNewAction(rc.ActionSpillForTest())
require.False(t, rc.AlreadySpilledSafeForTest())
err = rc.Add(chk)
rc.actionSpill.WaitForTest()
require.NoError(t, err)
require.False(t, rc.AlreadySpilledSafeForTest())
require.Equal(t, chk.MemoryUsage(), rc.GetMemTracker().BytesConsumed())
require.Equal(t, chk.MemoryUsage()+int64(8*chk.NumRows()), rc.GetMemTracker().BytesConsumed())
// The following line is erroneous, since chk is already handled by rc, Add it again causes duplicated memory usage account.
// It is only for test of spill, do not double-add a chunk elsewhere.
err = rc.Add(chk)
Expand Down

0 comments on commit a3c49bb

Please sign in to comment.