Skip to content

Commit 9446dbb

Browse files
committed
Merge branch '4.0.x'
Closes gh-50357
2 parents 8718273 + 5257df1 commit 9446dbb

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

smoke-test/spring-boot-smoke-test-cache/src/dockerTest/java/smoketest/cache/SampleCacheApplicationRedisTests.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@
1616

1717
package smoketest.cache;
1818

19+
import java.time.Duration;
20+
1921
import com.redis.testcontainers.RedisContainer;
22+
import org.awaitility.Awaitility;
2023
import org.junit.jupiter.api.Test;
2124
import org.testcontainers.junit.jupiter.Container;
2225
import org.testcontainers.junit.jupiter.Testcontainers;
@@ -52,9 +55,11 @@ void validateCache() {
5255
countries.clear(); // Simple test assuming the cache is empty
5356
assertThat(countries.get("BE")).isNull();
5457
Country be = this.countryRepository.findByCode("BE");
55-
ValueWrapper belgium = countries.get("BE");
56-
assertThat(belgium).isNotNull();
57-
assertThat((Country) belgium.get()).isEqualTo(be);
58+
Awaitility.waitAtMost(Duration.ofSeconds(10)).untilAsserted(() -> {
59+
ValueWrapper belgium = countries.get("BE");
60+
assertThat(belgium).isNotNull();
61+
assertThat((Country) belgium.get()).isEqualTo(be);
62+
});
5863
}
5964

6065
}

0 commit comments

Comments
 (0)