@@ -150,6 +150,7 @@ func generateResult(t *testing.T, ctx *mock.Context, dataSource *testutil.MockDa
150150 resultRows = append (resultRows , chk .GetRow (i ))
151151 }
152152 }
153+ require .False (t , aggExec .IsInvalidMemoryUsageTrackingForTest ())
153154 aggExec .Close ()
154155
155156 require .False (t , aggExec .IsSpillTriggeredForTest ())
@@ -315,6 +316,7 @@ func executeCorrecResultTest(t *testing.T, ctx *mock.Context, aggExec *aggregate
315316 resultRows = append (resultRows , chk .GetRow (i ))
316317 }
317318 }
319+ require .False (t , aggExec .IsInvalidMemoryUsageTrackingForTest ())
318320 aggExec .Close ()
319321
320322 require .True (t , aggExec .IsSpillTriggeredForTest ())
@@ -351,6 +353,7 @@ func fallBackActionTest(t *testing.T) {
351353 }
352354 chk .Reset ()
353355 }
356+ require .False (t , aggExec .IsInvalidMemoryUsageTrackingForTest ())
354357 aggExec .Close ()
355358 require .Less (t , 0 , newRootExceedAction .GetTriggeredNum ())
356359}
@@ -373,6 +376,7 @@ func randomFailTest(t *testing.T, ctx *mock.Context, aggExec *aggregate.HashAggE
373376 go func () {
374377 time .Sleep (time .Duration (rand .Int31n (300 )) * time .Millisecond )
375378 once .Do (func () {
379+ require .False (t , aggExec .IsInvalidMemoryUsageTrackingForTest ())
376380 aggExec .Close ()
377381 })
378382 goRoutineWaiter .Done ()
@@ -382,6 +386,7 @@ func randomFailTest(t *testing.T, ctx *mock.Context, aggExec *aggregate.HashAggE
382386 err := aggExec .Next (tmpCtx , chk )
383387 if err != nil {
384388 once .Do (func () {
389+ require .False (t , aggExec .IsInvalidMemoryUsageTrackingForTest ())
385390 err = aggExec .Close ()
386391 require .Equal (t , nil , err )
387392 })
@@ -393,6 +398,7 @@ func randomFailTest(t *testing.T, ctx *mock.Context, aggExec *aggregate.HashAggE
393398 chk .Reset ()
394399 }
395400 once .Do (func () {
401+ require .False (t , aggExec .IsInvalidMemoryUsageTrackingForTest ())
396402 aggExec .Close ()
397403 })
398404}
0 commit comments