diff --git a/util/profile/trackerrecorder_test.go b/util/profile/trackerrecorder_test.go index d1936673cfef8..1e8e624c6601d 100644 --- a/util/profile/trackerrecorder_test.go +++ b/util/profile/trackerrecorder_test.go @@ -18,11 +18,9 @@ import ( "math/rand" "testing" "time" - "unsafe" "github.com/pingcap/tidb/util/kvcache" "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" ) func TestHeapProfileRecorder(t *testing.T) { @@ -39,13 +37,15 @@ func TestHeapProfileRecorder(t *testing.T) { v := getRandomString(10) lru.Put(keys[i], v) } - bytes, err := col.getFuncMemUsage(kvcache.ProfileName) - require.Nil(t, err) - valueSize := int(unsafe.Sizeof(getRandomString(10))) - // ensure that the consumed bytes is at least larger than num * size of value - assert.LessOrEqual(t, int64(valueSize*num), bytes) - // we should assert lru size last and value size to reference lru in order to avoid gc + // TODO: TestHeapProfileRecorder is not stable, skip memory profile for now. + //bytes, err := col.getFuncMemUsage(kvcache.ProfileName) + //require.Nil(t, err) + // + //valueSize := int(unsafe.Sizeof(getRandomString(10))) + //// ensure that the consumed bytes is at least larger than num * size of value + //assert.LessOrEqual(t, int64(valueSize*num), bytes) + //// we should assert lru size last and value size to reference lru in order to avoid gc for _, k := range lru.Keys() { assert.Len(t, k.Hash(), 8) }