diff --git a/management/server/account_test.go b/management/server/account_test.go index 6fd48f227..0b2b97922 100644 --- a/management/server/account_test.go +++ b/management/server/account_test.go @@ -918,6 +918,7 @@ func TestAccountManager_DeleteAccount(t *testing.T) { } func BenchmarkTest_GetAccountWithclaims(b *testing.B) { + b.Setenv("NETBIRD_STORE_ENGINE", "postgres") claims := auth.UserAuth{ Domain: "example.com", UserId: "pvt-domain-user", @@ -945,6 +946,18 @@ func BenchmarkTest_GetAccountWithclaims(b *testing.B) { b.Fatal(err) } + a, err := am.Store.GetAccount(context.Background(), id) + if err != nil { + b.Fatal(err) + } + + a.Groups = genGroups() + + err = am.Store.SaveAccount(context.Background(), a) + if err != nil { + b.Fatal(err) + } + users := genUsers("priv", 100) acc, err := am.Store.GetAccount(context.Background(), id) @@ -1005,6 +1018,41 @@ func BenchmarkTest_GetAccountWithclaims(b *testing.B) { } +func genGroups() map[string]*types.Group { + return map[string]*types.Group{ + "one": { + Name: "one", + }, + "two": { + Name: "two", + }, + "three": { + Name: "three", + }, + "four": { + Name: "four", + }, + "five": { + Name: "five", + }, + "six": { + Name: "six", + }, + "seven": { + Name: "seven", + }, + "eight": { + Name: "eight", + }, + "nine": { + Name: "nine", + }, + "ten": { + Name: "ten", + }, + } +} + func genUsers(p string, n int) map[string]*types.User { users := map[string]*types.User{} now := time.Now()