Fix noinlineerr findings: internal/snapshot (refs #61)
This commit is contained in:
@@ -85,13 +85,16 @@ func TestCleanSnapshotDBEmptySnapshot(t *testing.T) {
|
||||
}
|
||||
|
||||
// Close the database
|
||||
if err := db.Close(); err != nil {
|
||||
err = db.Close()
|
||||
if err != nil {
|
||||
t.Fatalf("failed to close database: %v", err)
|
||||
}
|
||||
|
||||
// Copy database
|
||||
tempDBPath := filepath.Join(tempDir, "temp.db")
|
||||
if err := copyFile(fs, dbPath, tempDBPath); err != nil {
|
||||
|
||||
err = copyFile(fs, dbPath, tempDBPath)
|
||||
if err != nil {
|
||||
t.Fatalf("failed to copy database: %v", err)
|
||||
}
|
||||
|
||||
@@ -105,7 +108,9 @@ func TestCleanSnapshotDBEmptySnapshot(t *testing.T) {
|
||||
config: cfg,
|
||||
fs: fs,
|
||||
}
|
||||
if _, err := sm.cleanSnapshotDB(ctx, tempDBPath, snapshot.ID.String()); err != nil {
|
||||
|
||||
_, err = sm.cleanSnapshotDB(ctx, tempDBPath, snapshot.ID.String())
|
||||
if err != nil {
|
||||
t.Fatalf("failed to clean snapshot database: %v", err)
|
||||
}
|
||||
|
||||
@@ -171,13 +176,16 @@ func TestCleanSnapshotDBNonExistentSnapshot(t *testing.T) {
|
||||
}
|
||||
|
||||
// Close immediately
|
||||
if err := db.Close(); err != nil {
|
||||
err = db.Close()
|
||||
if err != nil {
|
||||
t.Fatalf("failed to close database: %v", err)
|
||||
}
|
||||
|
||||
// Copy database
|
||||
tempDBPath := filepath.Join(tempDir, "temp.db")
|
||||
if err := copyFile(fs, dbPath, tempDBPath); err != nil {
|
||||
|
||||
err = copyFile(fs, dbPath, tempDBPath)
|
||||
if err != nil {
|
||||
t.Fatalf("failed to copy database: %v", err)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user