junit-team/junit — pull request #904 by kay (2014-05-03 17:40:35+00:00)
Title: Support to allow the Timeout @Rule to become disabled when debugging without modification to the test class

Feature to disable the Timeout @rule when the test class being ran has been launched in debug mode. Allowing users to debug their tests without the timeout firing. This feature may be disabled by calling Timeout.whenDebugging(true) which forces the timeout to fire even during debugging.

Timeouts or time sensitive logic in the code under test is not handled by this feature and may make this unuseful in some circumstances. The important benefit of this feature is that you can suspend timeouts without any making any modifications to your test class to remove them during debugging. Anecdotally removing timeouts for debug purposes often results in developers forgetting to restore them.

In this pull-request I've enabled the feature by default. There is perhaps an argument to disable it by default and allow users to opt-in. I'm very open to discussion on this.

This feature somewhat relates to this https://github.com/junit-team/junit/issues/738

I've tried to keep as close to the JUnit projects conventions but please let me know if there is anything you'd prefer to be changed.