MSTest Timeout attribute not working as expected
Why can't i use const values in timeout attribute, example:
private const int TIME_OUT = 1000;
[TesMethod]
[Timeout(2 * TIME_OUT)]
public void testA(){
while(true);
}
Editing after comments:
It compiles but never stops in "timeout seco开发者_StackOverflow社区nds"
It's a bug in Visual Studio 2008 and this bug was fixed in VS2010
Are you running the test under the debugger? If so, then timeouts are disabled when under the debugger. Running from VS (not under debugger) or commandline should have timeouts enabled.
精彩评论