diff --git a/stores/metadata_test.go b/stores/metadata_test.go index 4b3395dcd..59feb2cc1 100644 --- a/stores/metadata_test.go +++ b/stores/metadata_test.go @@ -4127,7 +4127,13 @@ func TestSlabCleanup(t *testing.T) { HealthValidUntil: 100, } if err := ss.db.Create(&bufferedSlab).Error; err != nil { - t.Fatal(err) + if strings.Contains(err.Error(), "database table is locked") { + time.Sleep(time.Second) // wait for slabs to be pruned in the background + err = ss.db.Create(&bufferedSlab).Error + } + if err != nil { + t.Fatal(err) + } } obj3 := dbObject{ ObjectID: "3",