Open Closed

Backend Tests issue #6719


User avatar
0
paul.harriman created
  • ABP Framework version: v8.0.4
  • UI Type: Angular
  • Database System: EF Core SQL Server
  • Tiered (for MVC) or Auth Server Separated (for Angular): no
  • Exception message and full stack trace:
  • Steps to reproduce the issue:

When we upgraded our websites from 7 to 8.0.4 we ran into several issues when running our backend tests

System.InvalidOperationException : SqliteConnection does not support nested transactions. => we added code to disable uow when running tests

An error occurred during the initialize Volo.Abp.Modularity.OnApplicationInitializationModuleLifecycleContributor phase of the module Volo.Abp.OpenIddict.AbpOpenIddictDomainModule, Volo.Abp.OpenIddict.Domain, Version=8.0.4.0, Culture=neutral, PublicKeyToken=null: Timeout expired. The timeout elapsed prior to obtaining a distributed lock on the 'lock:recurring-job:HangfirePeriodicBackgroundWorkerAdapter<TokenCleanupBackgroundWorker>.DoWorkAsync' resource.. See the inner exception for details.. ==> If we run all the backend tests, some would fail, if we re-ran each individual test, they would pass. we implemented a fix which ran all the tests serially

Volo.Abp.AbpInitializationException : An error occurred during the initialize Volo.Abp.Modularity.OnApplicationInitializationModuleLifecycleContributor phase of the module OtisEd.Synergyz.SynergyzTestBaseModule, OtisEd.Synergyz.TestBase, Version=7.2.1.0, Culture=neutral, PublicKeyToken=null: The transaction object is not associated with the same connection object as this command.. See the inner exception for details. ==> backend tests run fine locally, but in github ci/cd they fail, sometimes, flaky

Do you have any suggestions?

Maybe is a way to remove hangfire from the tests. Mock the hangfire service instead of providing an actual database using in memory


15 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Can you try to add these code to your MyProjectNameEntityFrameworkCoreTestModule

    https://github.com/abpframework/abp/blob/rel-8.0/templates/app/aspnet-core/test/MyCompanyName.MyProjectName.EntityFrameworkCore.Tests/EntityFrameworkCore/MyProjectNameEntityFrameworkCoreTestModule.cs#L25-L40

  • User Avatar
    0
    paul.harriman created

    we have 2 websites, made sure they matched exactly what you had, one passed tests, the other did not

    Error Message: Volo.Abp.AbpInitializationException : An error occurred during the initialize Volo.Abp.Modularity.OnApplicationInitializationModuleLifecycleContributor phase of the module OtisEd.Synergyz.SynergyzTestBaseModule, OtisEd.Synergyz.TestBase, Version=7.2.1.0, Culture=neutral, PublicKeyToken=null: The transaction object is not associated with the same connection object as this command.. See the inner exception for details. ---- System.InvalidOperationException : The transaction object is not associated with the same connection object as this command.

  • User Avatar
    0
    scott7106 created

    We made a change which helped eliminate one of the two issues we were encountering. The lock issue was due to the package Hangfire.MemoryStorage. We were able to resolve this issue by switching to Hangfire.InMemory from HangfireIO. Parallel execution vs. serial execution no longer makes a difference in the results.

    We confirmed that our ConfigureServices exactly matches your example including the call to disable the UOW. We were missing the null conditional operator in the OnApplicationShutdown method. Adding this reduced the number of errors we are seeing. However, it has not eliminated them. We are still seeing random failures. We are not sure what it means, but we are seeing the issue more frequently on the GitHub action servers running Ubuntu 20.04 than on our Windows / MacOS development machines. It is happening at times on all 3 platforms, just more frequently in our GitHub actions.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Please share the full error stack. Thanks.

  • User Avatar
    0
    paul.harriman created

    So the pipeline in ci/cd ran several times, and it ran good, the last push got an error:

    Run dotnet test ./aspnet-core --configuration Release --no-build Test run for /home/runner/work/OtisEd.Zipline/OtisEd.Zipline/aspnet-core/test/OtisEd.Zipline.Application.Tests/bin/Release/net8.0/OtisEd.Zipline.Application.Tests.dll (.NETCoreApp,Version=v8.0) Microsoft (R) Test Execution Command Line Tool Version 17.9.0 (x64) Copyright (c) Microsoft Corporation. All rights reserved.

    Starting test execution, please wait... A total of 1 test files matched the specified pattern. Test run for /home/runner/work/OtisEd.Zipline/OtisEd.Zipline/aspnet-core/test/OtisEd.Zipline.EntityFrameworkCore.Tests/bin/Release/net8.0/OtisEd.Zipline.EntityFrameworkCore.Tests.dll (.NETCoreApp,Version=v8.0) Microsoft (R) Test Execution Command Line Tool Version 17.9.0 (x64) Copyright (c) Microsoft Corporation. All rights reserved.

    Starting test execution, please wait... A total of 1 test files matched the specified pattern.

    Passed! - Failed: 0, Passed: 122, Skipped: 0, Total: 122, Duration: 1 m 47 s - OtisEd.Zipline.EntityFrameworkCore.Tests.dll (net8.0) Test run for /home/runner/work/OtisEd.Zipline/OtisEd.Zipline/aspnet-core/test/OtisEd.Zipline.TestBase/bin/Release/net8.0/OtisEd.Zipline.TestBase.dll (.NETCoreApp,Version=v8.0) Microsoft (R) Test Execution Command Line Tool Version 17.9.0 (x64) Copyright (c) Microsoft Corporation. All rights reserved.

    Starting test execution, please wait... A total of 1 test files matched the specified pattern. No test is available in /home/runner/work/OtisEd.Zipline/OtisEd.Zipline/aspnet-core/test/OtisEd.Zipline.TestBase/bin/Release/net8.0/OtisEd.Zipline.TestBase.dll. Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again.

    Additionally, path to test adapters can be specified using /TestAdapterPath command. Example /TestAdapterPath:<pathToCustomAdapters>. Test run for /home/runner/work/OtisEd.Zipline/OtisEd.Zipline/aspnet-core/test/OtisEd.Zipline.Domain.Tests/bin/Release/net8.0/OtisEd.Zipline.Domain.Tests.dll (.NETCoreApp,Version=v8.0) Microsoft (R) Test Execution Command Line Tool Version 17.9.0 (x64) Copyright (c) Microsoft Corporation. All rights reserved.

    Starting test execution, please wait... A total of 1 test files matched the specified pattern.

    Passed! - Failed: 0, Passed: 1, Skipped: 0, Total: 1, Duration: < 1 ms - OtisEd.Zipline.Domain.Tests.dll (net8.0) [xUnit.net 00:02:47.64] OtisEd.Zipline.ValidationSeverities.SeveritiesAppServiceTests.GetListAsync [FAIL] Failed OtisEd.Zipline.ValidationSeverities.SeveritiesAppServiceTests.GetListAsync [1 ms] Error Message: Volo.Abp.AbpInitializationException : An error occurred during the initialize Volo.Abp.Modularity.OnApplicationInitializationModuleLifecycleContributor phase of the module OtisEd.Zipline.ZiplineTestBaseModule, OtisEd.Zipline.TestBase, Version=8.0.0.0, Culture=neutral, PublicKeyToken=null: Execute requires the command to have a transaction object when the connection assigned to the command is in a pending local transaction. The Transaction property of the command has not been initialized.. See the inner exception for details. ---- System.InvalidOperationException : Execute requires the command to have a transaction object when the connection assigned to the command is in a pending local transaction. The Transaction property of the command has not been initialized. Stack Trace: at Volo.Abp.Modularity.ModuleManager.InitializeModules(ApplicationInitializationContext context) at Volo.Abp.AbpApplicationBase.InitializeModules() at Volo.Abp.Testing.AbpIntegratedTest1..ctor() at OtisEd.Zipline.ValidationSeverities.SeveritiesAppServiceTests..ctor() in /home/runner/work/OtisEd.Zipline/OtisEd.Zipline/aspnet-core/test/OtisEd.Zipline.Application.Tests/ValidationSeverities/SeverityApplicationTests.cs:line 15 at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean wrapExceptions) ----- Inner Stack Trace ----- at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior) at Microsoft.Data.Sqlite.SqliteCommand.ExecuteDbDataReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable1.AsyncEnumerator.InitializeReaderAsync(AsyncEnumerator enumerator, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable1.AsyncEnumerator.MoveNextAsync() at Microsoft.EntityFrameworkCore.Query.ShapedQueryCompilingExpressionVisitor.SingleOrDefaultAsync[TSource](IAsyncEnumerable1 asyncEnumerable, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Query.ShapedQueryCompilingExpressionVisitor.SingleOrDefaultAsync[TSource](IAsyncEnumerable1 asyncEnumerable, CancellationToken cancellationToken) at Volo.Abp.Identity.EntityFrameworkCore.EfCoreIdentityUserRepository.FindByNormalizedUserNameAsync(String normalizedUserName, Boolean includeDetails, CancellationToken cancellationToken) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue1.ProceedAsync() at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) at Volo.Abp.Identity.IdentityDataSeeder.SeedAsync(String adminEmail, String adminPassword, Nullable1 tenantId) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue1.ProceedAsync() at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) at Volo.Abp.Data.DataSeeder.SeedAsync(DataSeedContext context) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous(IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapter.ProceedAsync() at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync(IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) at OtisEd.Zipline.ZiplineTestBaseModule.<>c__DisplayClass3_0.<<SeedTestData>b__0>d.MoveNext() in /home/runner/work/OtisEd.Zipline/OtisEd.Zipline/aspnet-core/test/OtisEd.Zipline.TestBase/ZiplineTestBaseModule.cs:line 60 --- End of stack trace from previous location --- at Nito.AsyncEx.Synchronous.TaskExtensions.WaitAndUnwrapException(Task task) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location --- at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) --- End of stack trace from previous location --- at Nito.AsyncEx.AsyncContext.Run(Func`1 action) at Volo.Abp.Modularity.ModuleManager.InitializeModules(ApplicationInitializationContext context)

    Failed! - Failed: 1, Passed: 221, Skipped: 0, Total: 222, Duration: 2 m 57 s - OtisEd.Zipline.Application.Tests.dll (net8.0) Error: Process completed with exit code 1.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    we implemented a fix which ran all the tests serially

    Can you share a test project that includes the unit test methods and your patch code?

    liming.ma@volosoft.com

  • User Avatar
    0
    scott7106 created

    hi,

    I send you an invite to our code repository. That will be the easiest way to share the code. If that does not work, please let me know and I will create a zip archive and get you a link to it.

    Please note, the tests will run several times successfully now before a failure occurs.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    ok.
    I will check the OtisEd.Synergyz repo.

    Thanks

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    https://github.com/otised-inc/OtisEd.Synergyz/pull/497

  • User Avatar
    0
    scott7106 created

    Still getting an occasional error.

    I ran all unit tests 4 times. I got one error on 2 of the 4 attempts. The full stack trace of both errors is included.

    Error #1 Volo.Abp.AbpInitializationException: An error occurred during the initialize Volo.Abp.Modularity.OnApplicationInitializationModuleLifecycleContributor...

    Volo.Abp.AbpInitializationException An error occurred during the initialize Volo.Abp.Modularity.OnApplicationInitializationModuleLifecycleContributor phase of the module OtisEd.Synergyz.SynergyzTestBaseModule, OtisEd.Synergyz.TestBase, Version=8.0.0.0, Culture=neutral, PublicKeyToken=null: The transaction object is not associated with the same connection object as this command.. See the inner exception for details. at Volo.Abp.Modularity.ModuleManager.InitializeModules(ApplicationInitializationContext context) at Volo.Abp.AbpApplicationBase.InitializeModules() at Volo.Abp.AbpApplicationWithExternalServiceProvider.Initialize(IServiceProvider serviceProvider) at Volo.Abp.Testing.AbpIntegratedTest1..ctor() at OtisEd.Synergyz.SynergyzTestBase1..ctor() at OtisEd.Synergyz.SynergyzApplicationTestBase..ctor() at OtisEd.Synergyz.ColumnDescriptions.ColumnDescriptionAppServiceTests..ctor() in C:\AppDev\OtisEd\OtisEd.Synergyz\aspnet-core\test\OtisEd.Synergyz.Application.Tests\ColumnDescriptions\ColumnDescriptionApplicationTests.cs:line 14 at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean wrapExceptions)

    System.InvalidOperationException The transaction object is not associated with the same connection object as this command. at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior) at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken) at Microsoft.Data.Sqlite.SqliteCommand.ExecuteDbDataReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable1.AsyncEnumerator.InitializeReaderAsync(AsyncEnumerator enumerator, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable1.AsyncEnumerator.MoveNextAsync() at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable1 source, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable1 source, CancellationToken cancellationToken) at Volo.Abp.SettingManagement.EntityFrameworkCore.EfCoreSettingRepository.GetListAsync(String providerName, String providerKey, CancellationToken cancellationToken) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue1.ProceedAsync() at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) at Volo.Abp.SettingManagement.SettingManagementStore.SetCacheItemsAsync(String providerName, String providerKey, String currentName, SettingCacheItem currentCacheItem) at Volo.Abp.SettingManagement.SettingManagementStore.GetCacheItemAsync(String name, String providerName, String providerKey) at Volo.Abp.SettingManagement.SettingManagementStore.GetOrNullAsync(String name, String providerName, String providerKey) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue1.ProceedAsync() at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) at Volo.Abp.Settings.UserSettingValueProvider.GetOrNullAsync(SettingDefinition setting) at Volo.Abp.Settings.SettingProvider.GetOrNullValueFromProvidersAsync(IEnumerable1 providers, SettingDefinition setting) at Volo.Abp.Settings.SettingProvider.GetOrNullAsync(String name) at Volo.Abp.Settings.SettingProviderExtensions.GetAsync[T](ISettingProvider settingProvider, String name, T defaultValue) at Volo.Abp.Identity.AbpIdentityOptionsManager.OverrideOptionsAsync(String name, IdentityOptions options) at Volo.Abp.Identity.IdentityDataSeeder.SeedAsync(String adminEmail, String adminPassword, Nullable1 tenantId) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue1.ProceedAsync() at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) at Volo.Abp.Data.DataSeeder.SeedAsync(DataSeedContext context) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous(IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapter.ProceedAsync() at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync(IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) at OtisEd.Synergyz.SynergyzTestBaseModule.<>c__DisplayClass3_0.<<SeedTestData>b__0>d.MoveNext() in C:\AppDev\OtisEd\OtisEd.Synergyz\aspnet-core\test\OtisEd.Synergyz.TestBase\SynergyzTestBaseModule.cs:line 61 --- End of stack trace from previous location --- at Nito.AsyncEx.Synchronous.TaskExtensions.WaitAndUnwrapException(Task task) at Nito.AsyncEx.AsyncContext.<>c__DisplayClass15_0.<Run>b__0(Task t) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location --- at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) --- End of stack trace from previous location --- at Nito.AsyncEx.Synchronous.TaskExtensions.WaitAndUnwrapException(Task task) at Nito.AsyncEx.AsyncContext.Run(Func1 action) at Volo.Abp.Threading.AsyncHelper.RunSync(Func`1 action) at OtisEd.Synergyz.SynergyzTestBaseModule.SeedTestData(ApplicationInitializationContext context) in C:\AppDev\OtisEd\OtisEd.Synergyz\aspnet-core\test\OtisEd.Synergyz.TestBase\SynergyzTestBaseModule.cs:line 57 at OtisEd.Synergyz.SynergyzTestBaseModule.OnApplicationInitialization(ApplicationInitializationContext context) in C:\AppDev\OtisEd\OtisEd.Synergyz\aspnet-core\test\OtisEd.Synergyz.TestBase\SynergyzTestBaseModule.cs:line 52 at Volo.Abp.Modularity.OnApplicationInitializationModuleLifecycleContributor.Initialize(ApplicationInitializationContext context, IAbpModule module) at Volo.Abp.Modularity.ModuleManager.InitializeModules(ApplicationInitializationContext context)

    Error #2 Volo.Abp.AbpInitializationException: An error occurred during the initialize Volo.Abp.Modularity.OnApplicationInitializationModuleLifecycleContributor...

    Volo.Abp.AbpInitializationException An error occurred during the initialize Volo.Abp.Modularity.OnApplicationInitializationModuleLifecycleContributor phase of the module OtisEd.Synergyz.SynergyzTestBaseModule, OtisEd.Synergyz.TestBase, Version=8.0.0.0, Culture=neutral, PublicKeyToken=null: Execute requires the command to have a transaction object when the connection assigned to the command is in a pending local transaction. The Transaction property of the command has not been initialized.. See the inner exception for details. at Volo.Abp.Modularity.ModuleManager.InitializeModules(ApplicationInitializationContext context) at Volo.Abp.AbpApplicationBase.InitializeModules() at Volo.Abp.AbpApplicationWithExternalServiceProvider.Initialize(IServiceProvider serviceProvider) at Volo.Abp.Testing.AbpIntegratedTest1..ctor() at OtisEd.Synergyz.SynergyzTestBase1..ctor() at OtisEd.Synergyz.SynergyzApplicationTestBase..ctor() at OtisEd.Synergyz.ModelColumns.ModelColumnAppServiceTests..ctor() in C:\AppDev\OtisEd\OtisEd.Synergyz\aspnet-core\test\OtisEd.Synergyz.Application.Tests\ModelColumns\ModelColumnApplicationTests.cs:line 32 at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean wrapExceptions)

    System.InvalidOperationException Execute requires the command to have a transaction object when the connection assigned to the command is in a pending local transaction. The Transaction property of the command has not been initialized. at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior) at Microsoft.Data.Sqlite.SqliteCommand.ExecuteDbDataReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable1.AsyncEnumerator.InitializeReaderAsync(AsyncEnumerator enumerator, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable1.AsyncEnumerator.MoveNextAsync() at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable1 source, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable1 source, CancellationToken cancellationToken) at Volo.Abp.SettingManagement.EntityFrameworkCore.EfCoreSettingRepository.GetListAsync(String providerName, String providerKey, CancellationToken cancellationToken) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue1.ProceedAsync() at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) at Volo.Abp.SettingManagement.SettingManagementStore.SetCacheItemsAsync(String providerName, String providerKey, String currentName, SettingCacheItem currentCacheItem) at Volo.Abp.SettingManagement.SettingManagementStore.GetCacheItemAsync(String name, String providerName, String providerKey) at Volo.Abp.SettingManagement.SettingManagementStore.GetOrNullAsync(String name, String providerName, String providerKey) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue1.ProceedAsync() at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) at Volo.Abp.Settings.UserSettingValueProvider.GetOrNullAsync(SettingDefinition setting) at Volo.Abp.Settings.SettingProvider.GetOrNullValueFromProvidersAsync(IEnumerable1 providers, SettingDefinition setting) at Volo.Abp.Settings.SettingProvider.GetOrNullAsync(String name) at Volo.Abp.Settings.SettingProviderExtensions.GetAsync[T](ISettingProvider settingProvider, String name, T defaultValue) at Volo.Abp.Identity.AbpIdentityOptionsManager.OverrideOptionsAsync(String name, IdentityOptions options) at Volo.Abp.Identity.IdentityDataSeeder.SeedAsync(String adminEmail, String adminPassword, Nullable1 tenantId) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue1.ProceedAsync() at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) at Volo.Abp.Data.DataSeeder.SeedAsync(DataSeedContext context) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous(IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapter.ProceedAsync() at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync(IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) at OtisEd.Synergyz.SynergyzTestBaseModule.&lt;&gt;c__DisplayClass3_0.&lt;&lt;SeedTestData&gt;b__0>d.MoveNext() in C:\AppDev\OtisEd\OtisEd.Synergyz\aspnet-core\test\OtisEd.Synergyz.TestBase\SynergyzTestBaseModule.cs:line 61 --- End of stack trace from previous location --- at Nito.AsyncEx.Synchronous.TaskExtensions.WaitAndUnwrapException(Task task) at Nito.AsyncEx.AsyncContext.&lt;&gt;c__DisplayClass15_0.&lt;Run&gt;b__0(Task t) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location --- at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) --- End of stack trace from previous location --- at Nito.AsyncEx.Synchronous.TaskExtensions.WaitAndUnwrapException(Task task) at Nito.AsyncEx.AsyncContext.Run(Func1 action) at Volo.Abp.Threading.AsyncHelper.RunSync(Func`1 action) at OtisEd.Synergyz.SynergyzTestBaseModule.SeedTestData(ApplicationInitializationContext context) in C:\AppDev\OtisEd\OtisEd.Synergyz\aspnet-core\test\OtisEd.Synergyz.TestBase\SynergyzTestBaseModule.cs:line 57 at OtisEd.Synergyz.SynergyzTestBaseModule.OnApplicationInitialization(ApplicationInitializationContext context) in C:\AppDev\OtisEd\OtisEd.Synergyz\aspnet-core\test\OtisEd.Synergyz.TestBase\SynergyzTestBaseModule.cs:line 52 at Volo.Abp.Modularity.OnApplicationInitializationModuleLifecycleContributor.Initialize(ApplicationInitializationContext context, IAbpModule module) at Volo.Abp.Modularity.ModuleManager.InitializeModules(ApplicationInitializationContext context)

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    I will do more tests.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Can you test this PR?

    https://github.com/otised-inc/OtisEd.Synergyz/pull/498/

  • User Avatar
    0
    scott7106 created

    We got close with this iteration. Out of 10 attempts, I only had 1 failed test.

    Volo.Abp.AbpInitializationException: An error occurred during the initialize Volo.Abp.Modularity.OnApplicationInitializationModuleLifecycleContributor...
    Volo.Abp.AbpInitializationException
    An error occurred during the initialize Volo.Abp.Modularity.OnApplicationInitializationModuleLifecycleContributor phase of the module OtisEd.Synergyz.SynergyzTestBaseModule, OtisEd.Synergyz.TestBase, Version=8.0.0.0, Culture=neutral, PublicKeyToken=null: Execute requires the command to have a transaction object when the connection assigned to the command is in a pending local transaction.  The Transaction property of the command has not been initialized.. See the inner exception for details.
       at Volo.Abp.Modularity.ModuleManager.InitializeModules(ApplicationInitializationContext context)
       at Volo.Abp.AbpApplicationBase.InitializeModules()
       at Volo.Abp.AbpApplicationWithExternalServiceProvider.Initialize(IServiceProvider serviceProvider)
       at Volo.Abp.Testing.AbpIntegratedTest`1..ctor()
       at OtisEd.Synergyz.SynergyzTestBase`1..ctor()
       at OtisEd.Synergyz.EntityFrameworkCore.SynergyzEntityFrameworkCoreTestBase..ctor()
       at OtisEd.Synergyz.AzureServers.AzureServerRepositoryTests..ctor() in C:\AppDev\OtisEd\OtisEd.Synergyz\aspnet-core\test\OtisEd.Synergyz.EntityFrameworkCore.Tests\AzureServers\AzureServerRepositoryTests.cs:line 17
       at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean wrapExceptions)
    
    System.InvalidOperationException
    Execute requires the command to have a transaction object when the connection assigned to the command is in a pending local transaction.  The Transaction property of the command has not been initialized.
       at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior)
       at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken)
       at Microsoft.Data.Sqlite.SqliteCommand.ExecuteDbDataReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken)
       at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
       at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
       at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.AsyncEnumerator.InitializeReaderAsync(AsyncEnumerator enumerator, CancellationToken cancellationToken)
       at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.AsyncEnumerator.MoveNextAsync()
       at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable`1 source, CancellationToken cancellationToken)
       at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable`1 source, CancellationToken cancellationToken)
       at Volo.Abp.SettingManagement.EntityFrameworkCore.EfCoreSettingRepository.GetListAsync(String providerName, String providerKey, CancellationToken cancellationToken)
       at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)
       at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()
       at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
       at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
       at Volo.Abp.SettingManagement.SettingManagementStore.SetCacheItemsAsync(String providerName, String providerKey, String currentName, SettingCacheItem currentCacheItem)
       at Volo.Abp.SettingManagement.SettingManagementStore.GetCacheItemAsync(String name, String providerName, String providerKey)
       at Volo.Abp.SettingManagement.SettingManagementStore.GetOrNullAsync(String name, String providerName, String providerKey)
       at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)
       at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()
       at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
       at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
       at Volo.Abp.Settings.UserSettingValueProvider.GetOrNullAsync(SettingDefinition setting)
       at Volo.Abp.Settings.SettingProvider.GetOrNullValueFromProvidersAsync(IEnumerable`1 providers, SettingDefinition setting)
       at Volo.Abp.Settings.SettingProvider.GetOrNullAsync(String name)
       at Volo.Abp.Settings.SettingProviderExtensions.GetAsync[T](ISettingProvider settingProvider, String name, T defaultValue)
       at Volo.Abp.Identity.AbpIdentityOptionsManager.OverrideOptionsAsync(String name, IdentityOptions options)
       at Volo.Abp.Identity.IdentityDataSeeder.SeedAsync(String adminEmail, String adminPassword, Nullable`1 tenantId)
       at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)
       at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()
       at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
       at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
       at Volo.Abp.Data.DataSeeder.SeedAsync(DataSeedContext context)
       at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous(IInvocation invocation, IInvocationProceedInfo proceedInfo)
       at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapter.ProceedAsync()
       at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
       at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync(IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
       at OtisEd.Synergyz.SynergyzTestBaseModule.&lt;&gt;c__DisplayClass4_0.&lt;&lt;SeedTestData&gt;b__0>d.MoveNext() in C:\AppDev\OtisEd\OtisEd.Synergyz\aspnet-core\test\OtisEd.Synergyz.TestBase\SynergyzTestBaseModule.cs:line 66
    --- End of stack trace from previous location ---
       at Nito.AsyncEx.Synchronous.TaskExtensions.WaitAndUnwrapException(Task task)
       at Nito.AsyncEx.AsyncContext.&lt;&gt;c__DisplayClass15_0.&lt;Run&gt;b__0(Task t)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
    --- End of stack trace from previous location ---
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
    --- End of stack trace from previous location ---
       at Nito.AsyncEx.Synchronous.TaskExtensions.WaitAndUnwrapException(Task task)
       at Nito.AsyncEx.AsyncContext.Run(Func`1 action)
       at Volo.Abp.Threading.AsyncHelper.RunSync(Func`1 action)
       at OtisEd.Synergyz.SynergyzTestBaseModule.SeedTestData(ApplicationInitializationContext context) in C:\AppDev\OtisEd\OtisEd.Synergyz\aspnet-core\test\OtisEd.Synergyz.TestBase\SynergyzTestBaseModule.cs:line 62
       at OtisEd.Synergyz.SynergyzTestBaseModule.OnApplicationInitialization(ApplicationInitializationContext context) in C:\AppDev\OtisEd\OtisEd.Synergyz\aspnet-core\test\OtisEd.Synergyz.TestBase\SynergyzTestBaseModule.cs:line 55
       at Volo.Abp.Modularity.OnApplicationInitializationModuleLifecycleContributor.Initialize(ApplicationInitializationContext context, IAbpModule module)
       at Volo.Abp.Modularity.ModuleManager.InitializeModules(ApplicationInitializationContext context)
    
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    I repeated the test hundreds of times and got no exceptions.

    You can continue to observe.

  • User Avatar
    0
    scott7106 created

    I have only seen the error once since the last update. Thank you for your assistance with this issue. We will open a new ticket if something changes.

Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11