layer1: add namespace bootstrap step 11

This commit is contained in:
Naeel
2026-04-26 10:02:37 +03:00
parent 66a3dc2a3c
commit 42acce308f
3 changed files with 55 additions and 0 deletions
+20
View File
@@ -137,4 +137,24 @@ func TestNamespaceManagerMarkPartStateDerivesPhase(t *testing.T) {
if record.Phase != NamespacePhaseFailed {
t.Fatalf("expected phase failed, got %s", record.Phase)
}
}
func TestNamespaceManagerBootstrap(t *testing.T) {
manager := NewNamespaceManager()
now := time.Now().UTC()
records := manager.Bootstrap([]string{"tenant-b", "tenant-a"}, NamespaceSourceBackfill, now)
if len(records) != 2 {
t.Fatalf("expected 2 bootstrap records, got %d", len(records))
}
if !reflect.DeepEqual([]string{"tenant-a", "tenant-b"}, manager.Snapshot()) {
t.Fatalf("expected manager snapshot to contain bootstrapped namespaces")
}
record, ok := manager.Get("tenant-a")
if !ok {
t.Fatalf("expected tenant-a after bootstrap")
}
if record.Source != NamespaceSourceBackfill {
t.Fatalf("expected bootstrap source backfill, got %s", record.Source)
}
}