@@ -517,7 +517,7 @@ void retryWithTimeoutExceededAfterFirstDelayButBeforeFirstRetry() throws Excepti
517517@ Test
518518void retryWithTimeoutExceededAfterFirstRetry () throws Exception {
519519RetryPolicy retryPolicy = RetryPolicy .builder ()
520- .timeout (Duration .ofMillis (5 ))
520+ .timeout (Duration .ofMillis (20 ))
521521.delay (Duration .ZERO )
522522.build ();
523523RetryTemplate retryTemplate = new RetryTemplate (retryPolicy );
@@ -527,15 +527,15 @@ void retryWithTimeoutExceededAfterFirstRetry() throws Exception {
527527Retryable <String > retryable = () -> {
528528int currentInvocation = invocationCount .incrementAndGet ();
529529if (currentInvocation == 2 ) {
530- Thread .sleep (10 );
530+ Thread .sleep (50 );
531531}
532532throw new CustomException ("Boom " + currentInvocation );
533533};
534534
535535assertThat (invocationCount ).hasValue (0 );
536536assertThatExceptionOfType (RetryException .class )
537537.isThrownBy (() -> retryTemplate .execute (retryable ))
538- .withMessageMatching ("Retry policy for operation '.+?' exceeded timeout \\ (5 ms\\ ); aborting execution" )
538+ .withMessageMatching ("Retry policy for operation '.+?' exceeded timeout \\ (20 ms\\ ); aborting execution" )
539539.withCause (new CustomException ("Boom 2" ))
540540.satisfies (throwable -> {
541541inOrder .verify (retryListener ).beforeRetry (retryPolicy , retryable );
@@ -552,7 +552,7 @@ void retryWithTimeoutExceededAfterFirstRetry() throws Exception {
552552@ Test
553553void retryWithTimeoutExceededAfterSecondRetry () throws Exception {
554554RetryPolicy retryPolicy = RetryPolicy .builder ()
555- .timeout (Duration .ofMillis (5 ))
555+ .timeout (Duration .ofMillis (20 ))
556556.delay (Duration .ZERO )
557557.build ();
558558RetryTemplate retryTemplate = new RetryTemplate (retryPolicy );
@@ -562,15 +562,15 @@ void retryWithTimeoutExceededAfterSecondRetry() throws Exception {
562562Retryable <String > retryable = () -> {
563563int currentInvocation = invocationCount .incrementAndGet ();
564564if (currentInvocation == 3 ) {
565- Thread .sleep (10 );
565+ Thread .sleep (50 );
566566}
567567throw new CustomException ("Boom " + currentInvocation );
568568};
569569
570570assertThat (invocationCount ).hasValue (0 );
571571assertThatExceptionOfType (RetryException .class )
572572.isThrownBy (() -> retryTemplate .execute (retryable ))
573- .withMessageMatching ("Retry policy for operation '.+?' exceeded timeout \\ (5 ms\\ ); aborting execution" )
573+ .withMessageMatching ("Retry policy for operation '.+?' exceeded timeout \\ (20 ms\\ ); aborting execution" )
574574.withCause (new CustomException ("Boom 3" ))
575575.satisfies (throwable -> {
576576var counter = new AtomicInteger (1 );
0 commit comments