diff --git a/EstateReportingAPI.BusinessLogic/QueryTimingInterceptor.cs b/EstateReportingAPI.BusinessLogic/QueryTimingInterceptor.cs index 7c8835a..f07b6f5 100644 --- a/EstateReportingAPI.BusinessLogic/QueryTimingInterceptor.cs +++ b/EstateReportingAPI.BusinessLogic/QueryTimingInterceptor.cs @@ -84,7 +84,7 @@ public ResolvedDbContext Resolve(String connectionStringKey, // Create an isolated service collection and provider ServiceCollection services = new(); services.AddDbContext(options => { - options.UseSqlServer(connectionString); + options.UseSqlServer(connectionString, sqlOptions => sqlOptions.EnableRetryOnFailure()); options.AddInterceptors(Interceptor); // attach here }); diff --git a/EstateReportingAPI.IntegrationTests/CustomWebApplicationFactory.cs b/EstateReportingAPI.IntegrationTests/CustomWebApplicationFactory.cs index f09be04..4339b0b 100644 --- a/EstateReportingAPI.IntegrationTests/CustomWebApplicationFactory.cs +++ b/EstateReportingAPI.IntegrationTests/CustomWebApplicationFactory.cs @@ -52,7 +52,7 @@ protected override void ConfigureWebHost(IWebHostBuilder builder) containerBuilder.AddTransient(_ => context); var serviceProvider = containerBuilder.BuildServiceProvider(); - + var inMemorySettings = new Dictionary { { "ConnectionStrings:TransactionProcessorReadModel", DatabaseConnectionString } @@ -71,8 +71,8 @@ protected override void ConfigureWebHost(IWebHostBuilder builder) containerBuilder.AddAuthentication(TestAuthHandler.AuthenticationScheme) .AddScheme(TestAuthHandler.AuthenticationScheme, options => { }); - - + + }); } diff --git a/EstateReportingAPI.IntegrationTests/xunit.runner.json b/EstateReportingAPI.IntegrationTests/xunit.runner.json index 29ceb58..a4c61e5 100644 --- a/EstateReportingAPI.IntegrationTests/xunit.runner.json +++ b/EstateReportingAPI.IntegrationTests/xunit.runner.json @@ -1,4 +1,4 @@ { - "maxParallelThreads": 3, - "parallelizeTestCollections": true + "maxParallelThreads": 1, + "parallelizeTestCollections": false } \ No newline at end of file