From a5533c7e45da45e91f7262d071cc8f3590d589b1 Mon Sep 17 00:00:00 2001 From: bcmmbaga Date: Fri, 12 Jul 2024 13:30:40 +0300 Subject: [PATCH] fix test --- management/server/account_test.go | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/management/server/account_test.go b/management/server/account_test.go index 751a55c3823..e6c9b60da88 100644 --- a/management/server/account_test.go +++ b/management/server/account_test.go @@ -1256,6 +1256,16 @@ func TestAccountManager_NetworkUpdates_DeleteGroup(t *testing.T) { }, } + if err := manager.DeletePolicy(context.Background(), account.Id, account.Policies[0].ID, userID); err != nil { + t.Errorf("delete default rule: %v", err) + return + } + + if err := manager.SavePolicy(context.Background(), account.Id, userID, &policy); err != nil { + t.Errorf("save policy: %v", err) + return + } + wg := sync.WaitGroup{} wg.Add(1) go func() { @@ -1269,7 +1279,10 @@ func TestAccountManager_NetworkUpdates_DeleteGroup(t *testing.T) { }() // clean policy is pre requirement for delete group - _ = manager.DeletePolicy(context.Background(), account.Id, policy.ID, userID) + if err := manager.DeletePolicy(context.Background(), account.Id, policy.ID, userID); err != nil { + t.Errorf("delete default rule: %v", err) + return + } if err := manager.DeleteGroup(context.Background(), account.Id, "", group.ID); err != nil { t.Errorf("delete group: %v", err)