fix(TestProfilingMem)_: enable run with -count=2

This commit is contained in:
Igor Sirotin 2024-08-21 09:47:01 +01:00
parent 2a5e0c3f71
commit 5dca5c1354
No known key found for this signature in database
GPG Key ID: 425E227CAAB81F95
1 changed files with 5 additions and 1 deletions

View File

@ -21,8 +21,12 @@ func WriteHeapFile(dataDir string) error {
if err != nil {
return err
}
defer memFile.Close() //nolint: errcheck
defer func() {
memFile.Close() //nolint: errcheck
memFile = nil
}()
}
runtime.GC()
err = pprof.WriteHeapProfile(memFile)