/** * Creates a {@link Timeout} that will timeout a test after the * given duration, in milliseconds. * * @since 4.12 */ public static Timeout millis(long millis) { return new Timeout(millis, TimeUnit.MILLISECONDS); }
/** * Creates a {@link Timeout} that will timeout a test after the * given duration, in seconds. * * @since 4.12 */ public static Timeout seconds(long seconds) { return new Timeout(seconds, TimeUnit.SECONDS); }
/** * Builds a {@link Timeout} instance using the values in this builder., */ public Timeout build() { return new Timeout(this); } }
/** * Creates the timeout rule that will be used to run the test. * * @return the rule used to check for test execution timeouts. */ protected TestRule createTestTimeoutRule() { int millisecondsTimeout = getTestTimeoutSecs() * 1000; if (isFailOnTimeout()) { return new DisableOnDebug(new Timeout(millisecondsTimeout)); } else { return new WarningTimeout(millisecondsTimeout); } }
/** * Builds a {@link Timeout} instance using the values in this builder., */ public Timeout build() { return new Timeout(this); } }
/** * Creates a {@link Timeout} that will timeout a test after the * given duration, in milliseconds. * * @since 4.12 */ public static Timeout millis(long millis) { return new Timeout(millis, TimeUnit.MILLISECONDS); }
/** * Builds a {@link Timeout} instance using the values in this builder., */ public Timeout build() { return new Timeout(this); } }
/** * Creates a {@link Timeout} that will timeout a test after the * given duration, in seconds. * * @since 4.12 */ public static Timeout seconds(long seconds) { return new Timeout(seconds, TimeUnit.SECONDS); }
/** * Creates a {@link Timeout} that will timeout a test after the * given duration, in milliseconds. * * @since 4.12 */ public static Timeout millis(long millis) { return new Timeout(millis, TimeUnit.MILLISECONDS); }
/** * Creates a {@link Timeout} that will timeout a test after the * given duration, in seconds. * * @since 4.12 */ public static Timeout seconds(long seconds) { return new Timeout(seconds, TimeUnit.SECONDS); }
@Rule public Timeout getTimeout() { int scalingFactor = 1; try { scalingFactor = Integer.parseInt(System.getProperty("timeout.factor")); } catch (NumberFormatException exception) { log.warn("Could not parse timeout.factor, not scaling timeout"); } return new Timeout(scalingFactor * 10, TimeUnit.MINUTES); }
/** * Creates the timeout rule that will be used to run the test. * * @return the rule used to check for test execution timeouts. */ protected TestRule createTestTimeoutRule() { int millisecondsTimeout = getTestTimeoutSecs() * 1000; if (isFailOnTimeout()) { return new DisableOnDebug(new Timeout(millisecondsTimeout)); } else { return new WarningTimeout(millisecondsTimeout); } }