DisableOnDebug DisableOnDebug 他の TestRule をラップして、 デバッグ実行されているときのみラップした TestRule を適用します。 import org.junit.Rule; import org.junit.Test; import org.junit.rules.DisableOnDebug; import org.junit.rules.TestRule; import org.junit.rules.Timeout; public class HogeTest { @Rule public TestRule timeout = new DisableOnDebug(Timeout.seconds(1)); //1秒以上かかったら失敗とみなす @Test public void testHoge() throws Exception {