How to increase latency for Visual Studio tests?

I am working on a fairly significant test suite for the code I am writing (in Visual Studio 2012). For the most part, running unit tests doesn't really matter. But I also include many integration tests, which have more external infrastructure dependencies. The number of tests combined with redefining the dependencies of the infrastructure between the tests leads to a rather lengthy test run for the full set (about 45 minutes at the moment).

Running tests is not a big deal. Unit tests will be carried out during registration, integration tests at night. However, I ran into a problem while trying to analyze code coverage for all tests. Code generation results are not generated, and the following is indicated in the output window:

This request operation sent to net.pipe: //megara/vstest.discoveryengine/14108 did not receive a response within the configured timeout (00:30:00). The time allotted for this operation may have been part of a longer timeout. This may be because the service is still processing the operation, or because the service was unable to send a response message. Please consider increasing the timeout (by moving the channel / proxy to IContextChannel and setting the OperationTimeout property) and make sure that the service can connect to the client.

I’m not sure where it is directing me. I do not use any iContextChannel for anything, all test work is built into Visual Studio. Therefore, I do not know where / how I can increase any timeout. Does anyone know where I should look?

+4
source share
2 answers

Try changing the timeout value in the solution file .testsettings .

If you don’t have one, you can add it to the solution using the right-click on solution -> Add New Item -> TestSettings . There you can do timeouts on individual tests (30 minutes by default) or set a timeout for the entire test run.

It is not clear whether this is the main reason or not, but it should be ruled out.

+6
source

An old topic, but perhaps new information: I could not set the timeout in the .testsettings file using Visual Studio 2015. Regardless of what I set in the test settings, my tests stopped after 30 minutes.

Now there is an attribute [Timeout(milliseconds)] , which can be applied to individual testing methods. This is even better than tests, as you can fine-tune individual tests to make sure they don't take longer than expected.

Unfortunately, I could not get this attribute to try to set it for more than 30 minutes when using the .testsettings file, even if the .testsettings file specified a higher timeout. Values ​​below 30 minutes have been met, but higher values ​​will still remain for 30 minutes, regardless of what the tests say.

After I deleted the .testsettings file, the timeout attributes seem to work as expected - the test will work until any timeout on which I set it.

If you are unable to get the timeout attribute to work, try removing .testsettings.

+2
source

All Articles