MCPcopy Create free account
hub / github.com/IceFireDB/IceFireDB / TestDB_Compact

Function TestDB_Compact

driver/hybriddb/db_test.go:279–298  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

277}
278
279func TestDB_Compact(t *testing.T) {
280 tempDir := t.TempDir()
281 cfg := &config.Config{
282 LevelDB: config.LevelDBConfig{
283 CacheSize: 64 * 1024 * 1024,
284 BlockSize: 4 * 1024,
285 WriteBufferSize: 4 * 1024 * 1024,
286 MaxOpenFiles: 1000,
287 Compression: true,
288 },
289 }
290
291 db, err := Store{}.Open(tempDir, cfg)
292 require.NoError(t, err)
293 defer db.Close()
294
295 // Compact should not error
296 err = db.Compact()
297 require.NoError(t, err)
298}
299
300func TestDB_Metrics(t *testing.T) {
301 tempDir := t.TempDir()

Callers

nothing calls this directly

Calls 3

CloseMethod · 0.65
OpenMethod · 0.45
CompactMethod · 0.45

Tested by

no test coverage detected