MCPcopy
hub / github.com/seaweedfs/seaweedfs / testWritebackLargeFile

Function testWritebackLargeFile

test/fuse_integration/writeback_cache_test.go:140–153  ·  view source on GitHub ↗

testWritebackLargeFile writes a large file (multi-chunk) with writebackCache

(t *testing.T, framework *FuseTestFramework)

Source from the content-addressed store, hash-verified

138
139// testWritebackLargeFile writes a large file (multi-chunk) with writebackCache
140func testWritebackLargeFile(t *testing.T, framework *FuseTestFramework) {
141 filename := "writeback_large.bin"
142 mountPath := filepath.Join(framework.GetMountPoint(), filename)
143
144 // 8MB file (spans multiple 2MB chunks)
145 content := make([]byte, 8*1024*1024)
146 _, err := rand.Read(content)
147 require.NoError(t, err)
148
149 require.NoError(t, os.WriteFile(mountPath, content, 0644))
150
151 // Wait for file to be fully flushed
152 waitForFileContent(t, mountPath, content, 60*time.Second)
153}
154
155// testWritebackEmptyFile creates an empty file with writebackCache
156func testWritebackEmptyFile(t *testing.T, framework *FuseTestFramework) {

Callers 1

Calls 4

waitForFileContentFunction · 0.85
GetMountPointMethod · 0.80
ReadMethod · 0.65
WriteFileMethod · 0.65

Tested by

no test coverage detected