Browse Source
Merge pull request #25630 from abpframework/maliming/fix-identityserver-test-sqlite-flaky
Wrap IdentityServer test seed in single UoW to fix flaky SQLite lock
pull/25631/head
Engincan VESKE
4 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
18 additions and
9 deletions
-
modules/identityserver/test/Volo.Abp.IdentityServer.TestBase/Volo/Abp/IdentityServer/AbpIdentityServerTestBaseModule.cs
|
|
|
@ -1,8 +1,9 @@ |
|
|
|
using Microsoft.Extensions.DependencyInjection; |
|
|
|
using Volo.Abp.Autofac; |
|
|
|
using Volo.Abp.Modularity; |
|
|
|
using Volo.Abp.Threading; |
|
|
|
|
|
|
|
using Microsoft.Extensions.DependencyInjection; |
|
|
|
using Volo.Abp.Autofac; |
|
|
|
using Volo.Abp.Modularity; |
|
|
|
using Volo.Abp.Threading; |
|
|
|
using Volo.Abp.Uow; |
|
|
|
|
|
|
|
namespace Volo.Abp.IdentityServer; |
|
|
|
|
|
|
|
[DependsOn( |
|
|
|
@ -38,9 +39,17 @@ public class AbpIdentityServerTestBaseModule : AbpModule |
|
|
|
{ |
|
|
|
using (var scope = context.ServiceProvider.CreateScope()) |
|
|
|
{ |
|
|
|
AsyncHelper.RunSync(() => scope.ServiceProvider |
|
|
|
.GetRequiredService<AbpIdentityServerTestDataBuilder>() |
|
|
|
.BuildAsync()); |
|
|
|
AsyncHelper.RunSync(async () => |
|
|
|
{ |
|
|
|
var unitOfWorkManager = scope.ServiceProvider.GetRequiredService<IUnitOfWorkManager>(); |
|
|
|
using (var uow = unitOfWorkManager.Begin(requiresNew: true)) |
|
|
|
{ |
|
|
|
await scope.ServiceProvider |
|
|
|
.GetRequiredService<AbpIdentityServerTestDataBuilder>() |
|
|
|
.BuildAsync(); |
|
|
|
await uow.CompleteAsync(); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|