KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have a set of Unit Tests run in parallel ( this is important, it works fine if the tests are run single-threaded ) which makes calls to WebClient to download a resource that consistently takes over 30 seconds to return, and this causes the Unit Test to forcefully exit with one of the following two messages: Thread was being aborted. The application domain in which the thread was running has been unloaded. I have tried setting the [Timeout] attribute, various app.config settings, including even creating an EventWaitHandle to make the unit test thread wait on the WebClient thread, with no luck. I checked the Test Timeouts settings under the Test Settings, and it is set to the default of 30 minutes. Edit 2: As indicated by @peer, this is a known bug in the VS.Net Test Framework: http://connect.microsoft.com/VisualStudio/feedback/details/587390/threadabortexception-when-running-two-tests-in-parallel-one-taking-40-seconds Edit: Here is the simplest scenario which will reproduce the problem. Can you make these Unit Tests run to completion, and if so, how? These tests must be run in parallel! Start a new Visual Studio Unit Test project, and use the following settings and Test Method code. When you run, make sure they are actually running in parallel (i.e., you will need a processor with multiple cores, and check that they are running simultaneously. I have found that to get them to run in parallel, I have to apply all the settings, then close the project and re-open it again before the parallelization will apply). Local.testsettings (add parallelTestCount="#"
Tags (comma-separated)
Save Edits
Cancel