0

I am running SQL Server CE unit tests with Visual Studio 2015.

Test output folder is default to

TestResults\user.name_HOST-PC 2016-12-18 15_36_34\Out

The problem is that tests are running fast and there are few tests that can run in same second, get equally same output directory and therefore lock the SQL Server CE .sdf file each to other.

I am looking for a way to tell to VS to create output folder with milliseconds or a GUI in folder name but did not find any solution

jessehouwing
  • 106,458
  • 22
  • 256
  • 341
Max Shlain
  • 67
  • 1
  • 6
  • Sounds more like an issue with your code!? – ErikEJ Dec 18 '16 at 16:36
  • Of course i can create locks that will not let to tests to run simultaneously, but my question comes to try to find the solution without locks. – Max Shlain Dec 18 '16 at 16:46
  • not sure i understand your use case, but to me it sounds like using "DeploymentItem" can be an option! http://stackoverflow.com/questions/649106/mstest-copy-file-to-test-run-folder – Jocke Dec 18 '16 at 20:15
  • I have already used the deployment item and it is deployed to test folder. The issue that the VS create test folders with time stamp resolution up to seconds. In my case there are few tests that run at same second, therefore the share same folder and same deployment item files. My question is if there any way to configure VS or MSTEST to create more unique folders. For example, milliseconds or GUID in test folder name could solve the issue. – Max Shlain Dec 19 '16 at 08:58

1 Answers1

0

Evenually, the solution (partial) was to generate globally unique file names to .sdf files.

I just added a GUID to .sdf database filename name, so even if two tests are running at the same second, they have different connection strings and work with different files

Max Shlain
  • 67
  • 1
  • 6