Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
bcmmbaga committed Jul 12, 2024
1 parent 5ebbef5 commit a5533c7
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion management/server/account_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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)
Expand Down

0 comments on commit a5533c7

Please sign in to comment.