Browse Source
Reduce iteration count in leading-zero stress test
pull/25558/head
maliming
4 months ago
No known key found for this signature in database
GPG Key ID: A646B9CB645ECEA4
1 changed files with
2 additions and
2 deletions
-
modules/identity/test/Volo.Abp.Identity.Domain.Tests/Volo/Abp/Identity/IdentityUserManager_Tests.cs
|
|
@ -493,7 +493,7 @@ public class IdentityUserManager_Tests : AbpIdentityDomainTestBase |
|
|
{ |
|
|
{ |
|
|
_identityUserManager.Options.User.AllowedUserNameCharacters = "admin0123"; |
|
|
_identityUserManager.Options.User.AllowedUserNameCharacters = "admin0123"; |
|
|
var sawLeadingZero = false; |
|
|
var sawLeadingZero = false; |
|
|
for (var i = 0; i < 500; i++) |
|
|
for (var i = 0; i < 100; i++) |
|
|
{ |
|
|
{ |
|
|
var username = await _identityUserManager.GetUserNameFromEmailAsync("admin@abp.io"); |
|
|
var username = await _identityUserManager.GetUserNameFromEmailAsync("admin@abp.io"); |
|
|
username.Length.ShouldBe(9); |
|
|
username.Length.ShouldBe(9); |
|
|
@ -504,7 +504,7 @@ public class IdentityUserManager_Tests : AbpIdentityDomainTestBase |
|
|
sawLeadingZero = true; |
|
|
sawLeadingZero = true; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
sawLeadingZero.ShouldBeTrue("expected at least one username with leading-zero random suffix across 500 runs"); |
|
|
sawLeadingZero.ShouldBeTrue("expected at least one username with leading-zero random suffix across 100 runs"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private async Task CreateRandomDefaultRoleAsync() |
|
|
private async Task CreateRandomDefaultRoleAsync() |
|
|
|