Browse Source
Wrap IdentityServer test seed in single UoW to fix flaky SQLite lock
pull/25630/head
maliming
4 months ago
No known key found for this signature in database
GPG Key ID: A646B9CB645ECEA4
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(); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|