Skip to content

Commit

Permalink
stores: avoid NDF in TestSlabCleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
peterjan committed Apr 19, 2024
1 parent 30019b8 commit ebbe18f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion stores/metadata_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit ebbe18f

Please sign in to comment.