@@ -8,7 +8,6 @@ import io.kotest.assertions.nondeterministic.eventually
88import io.kotest.assertions.throwables.shouldThrow
99import io.kotest.core.spec.style.FunSpec
1010import io.kotest.matchers.collections.shouldHaveSize
11- import io.kotest.matchers.longs.shouldBeGreaterThan
1211import io.kotest.matchers.shouldBe
1312import io.mockk.*
1413import kotlinx.coroutines.*
@@ -89,31 +88,6 @@ class ResilientHandlerTests :
8988 attemptCount.get() shouldBe 3
9089 }
9190
92- test(" should use exponential backoff" ) {
93- // arrange
94- val handler = ResilientHandler .Retrying .basic<String , String >(initialInterval = 100 .milliseconds)
95- val message = createTestMessage()
96- val context = createTestContext()
97- val timestamps = mutableListOf<Long >()
98-
99- // act
100- handler.handle(context, listOf (message)) { _, _ ->
101- timestamps.add(System .currentTimeMillis())
102- if (timestamps.size < 3 ) {
103- throw RuntimeException (" Simulated error" )
104- }
105- }
106-
107- // assert - delays should increase
108- timestamps.size shouldBe 3
109- if (timestamps.size >= 3 ) {
110- val firstDelay = timestamps[1 ] - timestamps[0 ]
111- val secondDelay = timestamps[2 ] - timestamps[1 ]
112- // Second delay should be longer than first (exponential backoff)
113- secondDelay shouldBeGreaterThan firstDelay
114- }
115- }
116-
11791 test(" basic factory method should work with custom config" ) {
11892 // arrange
11993 val handler = ResilientHandler .Retrying .basic<String , String >(
0 commit comments