nunitnunit-3.0nunit-console

Can NUnit TImeoutAttribute override NUnit Console Runner timeout?


I currently use NUnit Console to run my NUnit 3 tests. I pass a Timeout command-line option to NUnit Console Runner. This timeout is about 30 minutes, but I have one test that takes longer than 30 minutes, so I put a TimeoutAttribute on that one test. I assumed that TimeoutAttribute would take precedence over the global Timeout passed to the console runner. That does not seem to be the case. Seems like the TimeoutAttribute should take precedence or is there some other way I can do this besides changing the Timeout value passed on the command-line?


Solution

  • Assuming you have properly applied the TimeoutAttribute, it takes precedence over the nunit-console command-line option. The option could more properly be called "defaultTimeout".

    I'm "assuming" because you haven't included any code that shows where you actually placed the attribute or shown the command-line you are running. If you add those to the question, I'll correct this answer as needed.