From 0293e22910c7b87f05c69a34415acd6dc2b38cc5 Mon Sep 17 00:00:00 2001 From: Arjen Poutsma Date: Fri, 30 Sep 2022 15:53:21 +0200 Subject: [PATCH] Trying to fix flaky CoroutinesIntegrationTests --- .../method/annotation/CoroutinesIntegrationTests.kt | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/spring-webflux/src/test/kotlin/org/springframework/web/reactive/result/method/annotation/CoroutinesIntegrationTests.kt b/spring-webflux/src/test/kotlin/org/springframework/web/reactive/result/method/annotation/CoroutinesIntegrationTests.kt index 1e5b4f3243..3af6b1b886 100644 --- a/spring-webflux/src/test/kotlin/org/springframework/web/reactive/result/method/annotation/CoroutinesIntegrationTests.kt +++ b/spring-webflux/src/test/kotlin/org/springframework/web/reactive/result/method/annotation/CoroutinesIntegrationTests.kt @@ -40,7 +40,6 @@ import org.springframework.web.reactive.config.EnableWebFlux import org.springframework.web.testfixture.http.server.reactive.bootstrap.HttpServer import org.springframework.web.testfixture.http.server.reactive.bootstrap.UndertowHttpServer import reactor.core.publisher.Flux -import java.time.Duration class CoroutinesIntegrationTests : AbstractRequestMappingIntegrationTests() { @@ -123,7 +122,7 @@ class CoroutinesIntegrationTests : AbstractRequestMappingIntegrationTests() { val entity = performGet("/entity-flux", HttpHeaders.EMPTY, String::class.java) assertThat(entity.statusCode).isEqualTo(HttpStatus.OK) - assertThat(entity.body).isEqualTo("01234") + assertThat(entity.body).isEqualTo("foobar") } @ParameterizedHttpServerTest @@ -196,9 +195,8 @@ class CoroutinesIntegrationTests : AbstractRequestMappingIntegrationTests() { @GetMapping("/entity-flux") suspend fun entityFlux() : ResponseEntity> { - val strings = Flux.interval(Duration.ofMillis(100)).take(5) - .map { l -> l.toString() } - delay(10) + val strings = Flux.just("foo", "bar"); + delay(1) return ResponseEntity.ok().body(strings) }