Closed urasandesu closed 7 years ago
As a result of our investigation, we found that this problem cause is same as the reason that we are merging NUnit Test Adapter as Vendor Branch.
Indirection Stub is unintendedly crossed plural AppDomains by MsTest.
Against NUnit Test Adapter, we modified to fix that -- always running with DomainUsage=None
. Currently, we can't respond by same way because MsTest is closed source. However, Microsoft plans to open source MsTest (see Anand Kamat's comment). We might be able to fix same way if it will be achieved in the future.
Does this mean that we can try to use NUnit instead of MSTest and that might be a workaround for #89?
I think that NUnit will not be a complete workarround.
I guess that the test crash won't be to occur. But note that Prig couldn't be executed in the combination for NUnit and ReSharper when I tried.
MEMO I found another way to fix. To suppress unintendedly crossing plural AppDomains, we should strengthen the inspection that is performing by native code (JITed code). It seems that AppDomainID can be used for that. For example,
Thereby, Indirection Stub should never call different from AppDomain that the stub is set. However, we should be careful about the behavior of public interface, or this way will break backward-compatibility easily.
MEMO
To avoid FileLoadException, it turned out that we have to register framework assemblies (Urasandesu.NAnonym
, Urasandesu.Prig.Framework
) to GAC. So we should add the processing to our installer after this.
MEMO Some problems still remain if executing in multi-thread. We are going to release next version when they are resolved.
MEMO We have completed correcting all issues! :bowtie:
Remaining works are updating samples to next version and reviewing documents. We probably release next version within two weeks if there aren't any problems.
MEMO It turned out that a deadlock has been detected when running some tests from console runner.
When creating a test like the following example, MsTest will crash:
Product Code
Indirection Stub Setting for Product Code
Indirection Stub Setting for a shared member with MsTest that shouldn't matter In this example, we selected
List<T>.Add(T)
. There isEnvironment.CurrentDirectory
, but this means for to output crash dump easily.Test Code The point is that the above shared member is not used anywhere in our test code.
Crash Dump vstest.executionengine.exe.11312.txt