@@ -30,9 +30,9 @@ void calculateDelay_withRetryCountZero_shouldReturnBaseDelay() {
3030 Duration result = ExponentialBackoff .calculateDelay (retryCount , fixedRandom );
3131
3232 // Then
33- // For retry count 0: 2^0 * 500ms = 500ms base
34- // With jitter: between 500ms and 1000ms
35- assertThat (result .toMillis ()).isBetween (500L , 1000L );
33+ // For retry count 0: 2^0 * 100ms = 100ms base
34+ // With jitter: between 100ms and 200ms
35+ assertThat (result .toMillis ()).isBetween (100L , 200L );
3636 }
3737
3838 @ Test
@@ -45,9 +45,9 @@ void calculateDelay_withRetryCountOne_shouldReturnDoubledDelay() {
4545 Duration result = ExponentialBackoff .calculateDelay (retryCount , fixedRandom );
4646
4747 // Then
48- // For retry count 1: 2^1 * 500ms = 1000ms base
49- // With jitter: between 1000ms and 2000ms
50- assertThat (result .toMillis ()).isBetween (1000L , 2000L );
48+ // For retry count 1: 2^1 * 100ms = 200ms base
49+ // With jitter: between 200ms and 400ms
50+ assertThat (result .toMillis ()).isBetween (200L , 400L );
5151 }
5252
5353 @ Test
@@ -60,15 +60,15 @@ void calculateDelay_withRetryCountTwo_shouldReturnQuadrupledDelay() {
6060 Duration result = ExponentialBackoff .calculateDelay (retryCount , fixedRandom );
6161
6262 // Then
63- // For retry count 2: 2^2 * 500ms = 2000ms base
64- // With jitter: between 2000ms and 4000ms
65- assertThat (result .toMillis ()).isBetween (2000L , 4000L );
63+ // For retry count 2: 2^2 * 100ms = 400ms base
64+ // With jitter: between 400ms and 800ms
65+ assertThat (result .toMillis ()).isBetween (400L , 800L );
6666 }
6767
6868 @ Test
6969 void calculateDelay_withHighRetryCount_shouldCapAtMaximum () {
7070 // Given
71- int retryCount = 10 ; // This would normally result in 2^10 * 500ms = 512000ms
71+ int retryCount = 10 ; // This would normally result in 2^10 * 100ms = 102400ms
7272 Random fixedRandom = new Random (42 ); // Fixed seed for deterministic testing
7373
7474 // When
@@ -100,9 +100,9 @@ void calculateDelay_withoutRandomParameter_shouldReturnValidRange() {
100100 Duration result = ExponentialBackoff .calculateDelay (retryCount );
101101
102102 // Then
103- // For retry count 1: 2^1 * 500ms = 1000ms base
104- // With jitter: between 1000ms and 2000ms
105- assertThat (result .toMillis ()).isBetween (1000L , 2000L );
103+ // For retry count 1: 2^1 * 100ms = 200ms base
104+ // With jitter: between 200ms and 400ms
105+ assertThat (result .toMillis ()).isBetween (200L , 400L );
106106 }
107107
108108 @ Test
@@ -116,9 +116,9 @@ void calculateDelay_shouldProduceVariousResults() {
116116 Duration result3 = ExponentialBackoff .calculateDelay (retryCount );
117117
118118 // Then - all should be in valid range but likely different
119- assertThat (result1 .toMillis ()).isBetween (1000L , 2000L );
120- assertThat (result2 .toMillis ()).isBetween (1000L , 2000L );
121- assertThat (result3 .toMillis ()).isBetween (1000L , 2000L );
119+ assertThat (result1 .toMillis ()).isBetween (200L , 400L );
120+ assertThat (result2 .toMillis ()).isBetween (200L , 400L );
121+ assertThat (result3 .toMillis ()).isBetween (200L , 400L );
122122 }
123123
124124 @ Test
@@ -146,7 +146,7 @@ void calculateDelay_progressionTest_shouldFollowExponentialPattern() {
146146 // Reset the random seed for consistent results across iterations
147147 fixedRandom .setSeed (42 );
148148 Duration delay = ExponentialBackoff .calculateDelay (i , fixedRandom );
149- long expectedBaseMs = (long ) Math .pow (2 , i ) * 500 ;
149+ long expectedBaseMs = (long ) Math .pow (2 , i ) * 100 ;
150150 long expectedMaxMs = Math .min (expectedBaseMs * 2 , 120000 );
151151
152152 assertThat (delay .toMillis ())
@@ -159,7 +159,7 @@ void calculateDelay_progressionTest_shouldFollowExponentialPattern() {
159159 @ Test
160160 void calculateDelay_atCapThreshold_shouldCapCorrectly () {
161161 // Given - retry count that would exceed 120s base delay
162- int retryCount = 8 ; // 2^8 * 500ms = 128000ms > 120000ms
162+ int retryCount = 11 ; // 2^11 * 100ms = 204800ms > 120000ms
163163 Random fixedRandom = new Random (42 );
164164
165165 // When
0 commit comments