We have an NUnit test project with 1000 tests or so. The project contains high level component test mainly for a custom WPF control. The test process frequently fails on our build server (TeamCity) with:
InvalidOperationException "LocalDataStoreSlot storage has been freed"
mscorlib.dll!System.LocalDataStore.GetData(System.LocalDataStoreSlot slot)
mscorlib.dll!System.Threading.Thread.GetData(System.LocalDataStoreSlot slot)
WindowsBase.dll!System.Windows.Interop.ComponentDispatcher.CurrentThreadData.get() ...
The tests contain [RequiresSTA] attributes, Window.Show(), Dispatcher operations etc... so it is definitely not a regular unit test project.
The failure looks totally random, we have revisions where it occurs with 80% chance, however most of the time it doesn't happen at all. Absolutely mysterious, sometimes simple changes in the production code -like changing styles in the xaml code- triggers the failures, then the next change in the production code fixes it.
This specific random like failure makes our developer team pretty upset sometimes, our extended build system is hampered seriously by this failure.
We could very rarely reproduce it locally running the project with nunit-console.exe.
Have you guys ever seen such a test process failure? Any hints how to resolve this issue would be highly appreciated.
Thanks
We've encountered exactly the same issue in our environment (Jenkins, Windows 8, NUnit 2.6.3).
These measures fixed it for us.
/nothread
. If you're using the MS Build Community Tasks you need to set the TestInNewThread
attribute of the NUnit
task to false
.Some background information regarding the nature of the crash can be found in this MSDN forum thread. Eventually this needs to be fixed in NUnit.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With