1956
1957
// TestInitializeSystemNamespaces tests the initialization of system namespaces
1959
>
clusterName := "test-cluster"
1960
>
1961
>
// First initialization should succeed
1962
>
err1 := m.MetadataManager.InitializeSystemNamespaces(m.ctx, clusterName)
1963
>
m.NoError(err1)
1964
>
1965
>
// Verify the system namespace was created with correct properties
1966
>
resp, err2 := m.GetNamespace("", "temporal-system")
1967
>
m.NoError(err2)
1968
>
m.NotNil(resp)
1969
>
m.Equal("temporal-system", resp.Namespace.Info.Name)
1970
>
m.Equal("32049b68-7872-4094-8e63-d0dd59896a83", resp.Namespace.Info.Id)
1971
>
m.Equal(enumspb.NAMESPACE_STATE_REGISTERED, resp.Namespace.Info.State)
1972
>
m.Equal("Temporal internal system namespace", resp.Namespace.Info.Description)
1974
>
m.Equal(clusterName, resp.Namespace.ReplicationConfig.ActiveClusterName)
1975
>
m.Equal([]string{clusterName}, resp.Namespace.ReplicationConfig.Clusters)
1976
>
m.False(resp.IsGlobalNamespace)
1977
>
1978
>
// Second initialization should be idempotent
1979
>
err3 := m.MetadataManager.InitializeSystemNamespaces(m.ctx, clusterName)
1980
>
m.NoError(err3, "InitializeSystemNamespaces should be idempotent")
1981
>
}
1982
1983
// TestDeleteNamespaceIdempotency tests that delete operations are idempotent