Hi.
We are using Specflow 3.5 and XUnit as the test flavour to generate the tests. We are on NCrunch 4.3.0.13 currently, awaiting new licenses before we can upgrade...
I thought I understood the parallisation model used by NCrunch, but I'm seeing behaviour which conflicts with that understanding (which may be an issue in SpecFlow and not NCrunch)
Behaviour I'm seeing is this:
Start 3 tests with 2 test max parallelism.
Test 1 calls [BeforeTestRun] from process dotnet, with process Id 1000 and I initialise a static WebDriver
Test 2 calls [BeforeTestRun] from process dotnet, with process Id 2000 and I initialise a static WebDriver
Test 1 (or test 2) completes, and calls [AfterTestRun] which disposes the static webdriver.
Test 3 is started. My understanding is that NCrunch will reuse existing process to run test 3 to save creating a new test process etc
Test 3 calls [BeforeTestRun] from process dotnet, with process Id 1000 (or 2000) and things fall over because WebDriver is already initialised.
I would expect that [AfterTestRun] is not called because the test process has not been finished with, as it is reused
I would expect that [BeforeTestRun] is not called because the environment has already been initialised for this process and so static variables are set up already.
We create a single static WebDriver so when many tests are run in sequence the runtime is reduced (previously the tests were run without NCrunch, but now we want to distribute the tests across the NCrunch grid)
Is this an NCrunch issue? Or is it something that specflow needs to fix?
There was a similar issue with specflow and NUnit previously so I wonder if this is similar:
https://github.com/SpecF...OSS/SpecFlow/issues/638
If it is a specflow issue, I may be able to fix that. I'll try and look at that option over the weekend, but wanted to post this issue in case there is something on the NCRunch side which is causing this.