I'm running into an issue where my tests timeout after 30 minutes. Any id开发者_StackOverfloweas on setting infinite timeout? I've tried Timeout(0), but it still throws a timeout after 30 minutes.
I'm running these unit tests in Visual Studio 2008.
Since 30 minutes is the default timeout for a unit test in the Visual Studio test framework, I'm going to take a guess that this is what you're referring to. If not, please provide more details.
You can set this timeout in at least two ways:
- Decorate specific
TestMethods
with an attribute:[Timeout(TestTimeout.Infinite)];
or - Using
Test -> Edit Test Settings -> [settings you're using] -> Test Timeouts
.
Note that if you do this using (2), you will have to close and re-open your solution in VS before the change is applied.
It worked for me. You have to add it to the C# test code, just above the test method:
[Timeout(TestTimeout.Infinite)]
[TestMethod()]
精彩评论