MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / TestNewMetaFile_Memory

Function TestNewMetaFile_Memory

internal/utils/bfs/meta_file_test.go:51–77  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

49}
50
51func TestNewMetaFile_Memory(t *testing.T) {
52 var count = 2
53
54 if testutils.IsSingleTesting() {
55 count = 100
56 }
57
58 var stat1 = testutils.ReadMemoryStat()
59
60 var mFiles []*bfs.MetaFile
61
62 for i := 0; i < count; i++ {
63 mFile, err := bfs.OpenMetaFile("testdata/test2.m", &sync.RWMutex{})
64 if err != nil {
65 if bfs.IsNotExist(err) {
66 continue
67 }
68 t.Fatal(err)
69 }
70
71 _ = mFile.Close()
72 mFiles = append(mFiles, mFile)
73 }
74
75 var stat2 = testutils.ReadMemoryStat()
76 t.Log((stat2.HeapInuse-stat1.HeapInuse)>>20, "MiB")
77}
78
79func TestMetaFile_FileHeaders(t *testing.T) {
80 mFile, openErr := bfs.OpenMetaFile("testdata/test2.m", &sync.RWMutex{})

Callers

nothing calls this directly

Calls 6

IsSingleTestingFunction · 0.92
ReadMemoryStatFunction · 0.92
OpenMetaFileFunction · 0.92
IsNotExistFunction · 0.92
LogMethod · 0.80
CloseMethod · 0.65

Tested by

no test coverage detected