From cae86676d4ca4cc2ec1acf9444e81596d2ac2123 Mon Sep 17 00:00:00 2001 From: baerwang <52104949+baerwang@users.noreply.github.com> Date: Tue, 22 Aug 2023 10:34:50 +0800 Subject: [PATCH] fix: security ut tenants sort (#751) --- pkg/security/tenant_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/security/tenant_test.go b/pkg/security/tenant_test.go index 0672bedb..55d5d7bf 100644 --- a/pkg/security/tenant_test.go +++ b/pkg/security/tenant_test.go @@ -45,7 +45,9 @@ func TestSimpleTenantManager(t *testing.T) { tm.PutCluster("fake-tenant", "fake-cluster") tm.PutUser("fake-tenant", &config.User{Username: "fake-user"}) tm.PutUser("arana-tenant", &config.User{Username: "arana-user"}) - assert.Equal(t, tm.GetTenants(), []string{"fake-tenant", "arana-tenant"}) + tenants = tm.GetTenants() + assert.Len(t, tenants, 2) + assert.Contains(t, tenants, "fake-tenant", "arana-tenant") var ( user *config.User