From 6363ba7e6ee9c37674041fdd50c00904ed1b1e61 Mon Sep 17 00:00:00 2001 From: Chris Schinnerl Date: Wed, 31 Jul 2024 10:41:46 +0200 Subject: [PATCH] stores: add partial slab to TestUnhealthySlabs --- autopilot/migrator.go | 3 +++ stores/metadata_test.go | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/autopilot/migrator.go b/autopilot/migrator.go index 08c0a9c93..173bedcc5 100644 --- a/autopilot/migrator.go +++ b/autopilot/migrator.go @@ -297,6 +297,9 @@ OUTER: case jobs <- job{slab, i, len(toMigrate), set, b}: } } + + // all slabs migrated + return } } diff --git a/stores/metadata_test.go b/stores/metadata_test.go index a5ff944df..170f4990d 100644 --- a/stores/metadata_test.go +++ b/stores/metadata_test.go @@ -1748,6 +1748,12 @@ func TestUnhealthySlabs(t *testing.T) { t.Fatal(err) } + // add a partial slab + _, _, err = ss.AddPartialSlab(context.Background(), []byte{1, 2, 3}, 1, 3, testContractSet) + if err != nil { + t.Fatal(err) + } + if err := ss.RefreshHealth(context.Background()); err != nil { t.Fatal(err) }