MCPcopy Create free account
hub / github.com/ByteStorage/FlyDB / TestDB_Sync

Function TestDB_Sync

engine/db_test.go:410–425  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

408}
409
410func TestDB_Sync(t *testing.T) {
411 opts := config.DefaultOptions
412 dir, _ := os.MkdirTemp("", "flydb-close")
413 opts.DirPath = dir
414 opts.DataFileSize = 64 * 1024 * 1024
415 db, err := NewDB(opts)
416 defer destroyDB(db)
417 assert.Nil(t, err)
418 assert.NotNil(t, db)
419
420 err = db.Put(randkv.GetTestKey(10), randkv.GetTestKey(10))
421 assert.Nil(t, err)
422
423 err = db.Sync()
424 assert.Nil(t, err)
425}

Callers

nothing calls this directly

Calls 5

PutMethod · 0.95
SyncMethod · 0.95
GetTestKeyFunction · 0.92
NewDBFunction · 0.85
destroyDBFunction · 0.85

Tested by

no test coverage detected