Parallel execution with SharedAppDomain - Console output mixed together
AnsweredI'm trying to run a hundred tests in parallel with SpecFlow+Runner 3.7.3, netcore31, x64 mode on Windows Server 2019. The code is using SpecFlow 3.7.13.
Below are my Execution and Environment elements in default.sprofile. I'm using thread isolation level (SharedAppDomain).
<Execution stopAfterFailures="0" testThreadCount="100" testSchedulingMode="Sequential" retryCount="0" />
<Environment testThreadIsolation="SharedAppDomain" />
I was able to spawn 100 threads at the same time. The tests ran to completion. However, in the HTML report the console outputs from different tests were mixed together. I'm unable to associate the output with the corresponding test case.
Before I used Specflow I was using MsTest v2 parallel execution. I ran into a similar issue. The fix was to use TestContext. However, here I'm using Specflow+Runner rather than MsTest.
Any help is appreciated!
Eric
-
When you use SharedAppDomain test thread isolation with Console output you get this behavior.
The Console Output is also a memory object that is shared with all threads. It is like accessing a static object with SharedAppDomain isolation.
It works with the TestContext in MSTest, because with it, every test has its own instance.
The only workaround if you want to stay with the SpecFlow+ Runner is to switch to Process isolation.
If you can't do this, you would need to switch test runner.
0
Please sign in to leave a comment.
Comments
1 comment