Skip to content

Commit

Permalink
add comment for time.sleep
Browse files Browse the repository at this point in the history
  • Loading branch information
wshwsh12 committed Sep 26, 2022
1 parent 29bf319 commit 8fea589
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions executor/executor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6091,8 +6091,8 @@ func TestGlobalMemoryControl(t *testing.T) {
tracker2.Consume(200 << 20) // 200 MB
tracker3.Consume(300 << 20) // 300 MB

test := make([]int, 128<<20) // Keep 1GB HeapInUse
time.Sleep(500 * time.Millisecond)
test := make([]int, 128<<20) // Keep 1GB HeapInUse
time.Sleep(500 * time.Millisecond) // The check goroutine checks the memory usage every 100ms. The Sleep() make sure that Top1Tracker can be Canceled.

// Kill Top1
require.False(t, tracker1.NeedKill.Load())
Expand Down

0 comments on commit 8fea589

Please sign in to comment.