From f29c707e6c56303f70e34584298d99e727583937 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Tue, 13 Apr 2021 21:05:26 -0700 Subject: [PATCH] Increase SampleSessionApplicationTests timeout Increase timeout in `SampleSessionApplicationTests` to fix flaky local builds. --- .../java/smoketest/session/SampleSessionApplicationTests.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-session/src/test/java/smoketest/session/SampleSessionApplicationTests.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-session/src/test/java/smoketest/session/SampleSessionApplicationTests.java index 78e518c2a3..70867a4bd3 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-session/src/test/java/smoketest/session/SampleSessionApplicationTests.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-session/src/test/java/smoketest/session/SampleSessionApplicationTests.java @@ -51,14 +51,14 @@ class SampleSessionApplicationTests { String cookie = firstResponse.getHeaders().getFirst("Set-Cookie"); String sessionId2 = nextRequest(restTemplate, uri, cookie).getBody(); assertThat(sessionId1).isEqualTo(sessionId2); - Thread.sleep(1000); + Thread.sleep(2100); String loginPage = nextRequest(restTemplate, uri, cookie).getBody(); assertThat(loginPage).containsIgnoringCase("login"); } private ConfigurableApplicationContext createContext() { ConfigurableApplicationContext context = new SpringApplicationBuilder().sources(SampleSessionApplication.class) - .properties("server.port:0", "server.servlet.session.timeout:1") + .properties("server.port:0", "server.servlet.session.timeout:2") .initializers(new ServerPortInfoApplicationContextInitializer()).run(); return context; }