Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ void shouldEventuallyAssertAConstant() {
*/
@Test
void shouldRetryForASpecificTimeout() {
final var duration = Duration.ofSeconds(1);
final var duration = Duration.ofMillis(500);
final var timeout = Timeout.of(duration);
final var start = Instant.now();

Expand Down Expand Up @@ -113,7 +113,7 @@ void shouldFailFast() {
@Test
void shouldRetryRetryableLambdaThrowingARuntimeException() {

final var duration = Duration.ofSeconds(1);
final var duration = Duration.ofMillis(500);
final var timeout = Timeout.of(duration);
final var start = Instant.now();

Expand Down Expand Up @@ -212,7 +212,7 @@ void shouldFailFastWithAnAsynchronouslyCompletedCompletableFuture()
final Thread thread = Thread.startVirtualThread(() -> {
// wait for a second to allow the Eventually to start checking
try {
Thread.sleep(1000);
Thread.sleep(500);
}
catch (final Exception e) {

Expand Down Expand Up @@ -255,7 +255,7 @@ void shouldFailFastWithAnAsynchronouslyExceptionalCompletableFuture()
final Thread thread = Thread.startVirtualThread(() -> {
// wait for a second to allow the Eventually to start checking
try {
Thread.sleep(1000);
Thread.sleep(500);
}
catch (final Exception e) {

Expand Down Expand Up @@ -287,7 +287,7 @@ void shouldFailFastWithAnAsynchronouslyExceptionalCompletableFuture()
void shouldRetryARunnableThrowingARuntimeException() {
assertThrows(AssertionError.class, () -> {
// establish a Timeout for Eventually.assertThat(...)
final var duration = Duration.ofSeconds(2);
final var duration = Duration.ofMillis(500);
final var timeout = Timeout.of(duration);

// establish a counter to determine the number of retries
Expand Down Expand Up @@ -322,7 +322,7 @@ void shouldRetryARunnableThrowingARuntimeException() {
void shouldRetryARunnableThrowingAnAssertionError() {
assertThrows(AssertionError.class, () -> {
// establish a Timeout for Eventually.assertThat(...)
final var duration = Duration.ofSeconds(2);
final var duration = Duration.ofMillis(500);
final var timeout = Timeout.of(duration);

// establish a counter to determine the number of retries
Expand Down Expand Up @@ -355,7 +355,7 @@ void shouldRetryARunnableThrowingAnAssertionError() {
@Test
void shouldInvokeARunnableOnceAndOnlyOnce() {
// establish a Timeout for Eventually.assertThat(...)
final var duration = Duration.ofSeconds(2);
final var duration = Duration.ofMillis(500);
final var timeout = Timeout.of(duration);

// establish a counter to determine the number of retries
Expand Down Expand Up @@ -386,7 +386,7 @@ void shouldInvokeARunnableOnceAndOnlyOnce() {
*/
@Test
void shouldPreserveUnderlyingCause() {
final var timeout = Timeout.of(Duration.ofSeconds(2));
final var timeout = Timeout.of(Duration.ofMillis(500));
final Function<String, String> normalFunction = s -> s;
final RuntimeException runtimeException = new RuntimeException("exceptional");
final Function<String, String> exceptionalFunction = s -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class BlockingRetryTests {
@Test
void shouldRetryForASpecificTimeout() {
assertTimeout(TIMEOUT, () -> {
final var duration = Duration.ofSeconds(2);
final var duration = Duration.ofMillis(500);
final var timeout = Timeout.of(duration);

final var start = Instant.now();
Expand Down Expand Up @@ -164,7 +164,7 @@ void shouldSucceedFastWithNullConstant() {
@Test
void shouldDelayRetrying() {
assertTimeout(TIMEOUT, () -> {
final var duration = Duration.ofSeconds(2);
final var duration = Duration.ofMillis(500);

final var start = Instant.now();

Expand Down Expand Up @@ -234,7 +234,7 @@ void shouldRetryOnceWithZeroTimeout() {
@Test
void shouldUseAMaximumDelay() {
assertTimeout(TIMEOUT, () -> {
final var maximumDuration = Duration.ofSeconds(1);
final var maximumDuration = Duration.ofMillis(500);
final var timeoutDuration = Duration.ofSeconds(2);

final var start = Instant.now();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ void shouldUseTelemetryRecorder()
try (final var meter = telemetryRecorder.commence(100, "This should be fun!");
final var anotherMeter = telemetryRecorder.commence(50, "A second meter")) {

for (int i = 1; i <= 100; i++) {
for (int i = 1; i <= 10; i++) {
meter.progress();

Thread.sleep(100);
Expand Down