Skip to content

Commit

Permalink
Set timeouts for spring-boot tests to avoid long-runnings
Browse files Browse the repository at this point in the history
  • Loading branch information
romtsn committed Dec 29, 2023
1 parent ff1e6a3 commit 78a44b1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import org.springframework.http.HttpHeaders
import org.springframework.http.HttpMethod
import org.springframework.http.HttpStatus
import org.springframework.web.client.RestTemplate
import java.time.Duration
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertNotNull
Expand All @@ -37,7 +38,10 @@ class SentrySpanRestTemplateCustomizerTest {
class Fixture {
val sentryOptions = SentryOptions()
val hub = mock<IHub>()
val restTemplate = RestTemplateBuilder().build()
val restTemplate = RestTemplateBuilder()
.setConnectTimeout(Duration.ofSeconds(2))
.setReadTimeout(Duration.ofSeconds(2))
.build()
var mockServer = MockWebServer()
val transaction: SentryTracer
internal val customizer = SentrySpanRestTemplateCustomizer(hub)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import org.springframework.http.HttpHeaders
import org.springframework.http.HttpMethod
import org.springframework.http.HttpStatus
import org.springframework.web.client.RestTemplate
import java.time.Duration
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertNotNull
Expand All @@ -37,7 +38,10 @@ class SentrySpanRestTemplateCustomizerTest {
class Fixture {
val sentryOptions = SentryOptions()
val hub = mock<IHub>()
val restTemplate = RestTemplateBuilder().build()
val restTemplate = RestTemplateBuilder()
.setConnectTimeout(Duration.ofSeconds(2))
.setReadTimeout(Duration.ofSeconds(2))
.build()
var mockServer = MockWebServer()
val transaction: SentryTracer
internal val customizer = SentrySpanRestTemplateCustomizer(hub)
Expand Down

0 comments on commit 78a44b1

Please sign in to comment.