nunitnunit-console

How to set global timeout for project in NUnit


I want to set a global timeout for running a project in NUnit so that all tests in the project in total do not exceed for example 1 hour and sequential execution of tests is interrupted when this timeout is exceeded. That is, some part of the tests will have time to run, and some part will not be executed because the total timeout will be exceeded. All the solutions that I found allow you to set a timeout for each test separately. Is it possible to somehow set a general timeout, since some tests can go 1 minute and some 1 second, and the total summed timeout simplifies the launch and limits for a project with tests.


Solution

  • Not through the NUnit framework itself, which only supports timeout on individual tests. Generally, an overall timeout is a function of the runner or the CI system used to run the tests.

    There is an outstanding issue for the NUnit console runner, which asks for a general timeout parameter.