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

Function TestNewOpenFileCache_CloseAll

internal/caches/open_file_cache_test.go:53–69  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

51}
52
53func TestNewOpenFileCache_CloseAll(t *testing.T) {
54 cache, err := caches.NewOpenFileCache(1024)
55 if err != nil {
56 t.Fatal(err)
57 }
58 cache.Debug()
59 cache.Put("a.txt", caches.NewOpenFile(nil, nil, nil, 0, 1))
60 cache.Put("b.txt", caches.NewOpenFile(nil, nil, nil, 0, 1))
61 cache.Put("c.txt", caches.NewOpenFile(nil, nil, nil, 0, 1))
62 cache.Get("b.txt")
63 cache.Get("d.txt")
64 cache.CloseAll()
65
66 if testutils.IsSingleTesting() {
67 time.Sleep(6 * time.Second)
68 }
69}

Callers

nothing calls this directly

Calls 7

DebugMethod · 0.95
PutMethod · 0.95
GetMethod · 0.95
CloseAllMethod · 0.95
NewOpenFileCacheFunction · 0.92
NewOpenFileFunction · 0.92
IsSingleTestingFunction · 0.92

Tested by

no test coverage detected