TransactionProcessing / EstateAdministrationUI

0 stars 0 forks source link

Move Integration Tests with Reqnroll to use NUnit #519

Closed StuartFerguson closed 4 months ago

StuartFerguson commented 5 months ago

Add this to the test project AssemblyInfo.cs to control parallel testing

[assembly: LevelOfParallelism(2)] [assembly: Parallelizable(ParallelScope.Fixtures)]

StuartFerguson commented 5 months ago

Add the following locking code to prevent Sql Server container errors during concurrent tests GlobalSetup method

// Only one thread can execute this block at a time lock (Setup.padLock) { Setup.DatabaseServerNetwork = dockerHelper.SetupTestNetwork("sharednetwork");

dockerHelper.Logger.LogInformation("in start SetupSqlServerContainer"); Setup.DatabaseServerContainer = dockerHelper.SetupSqlServerContainer(Setup.DatabaseServerNetwork).Result; }

static object padLock = new object(); // Object to lock on