|
21 | 21 |
|
22 | 22 | import static io.lettuce.TestTags.UNIT_TEST; |
23 | 23 | import static org.assertj.core.api.Assertions.*; |
| 24 | +import static org.junit.jupiter.api.Timeout.ThreadMode.SEPARATE_THREAD; |
24 | 25 | import static org.mockito.ArgumentMatchers.*; |
25 | 26 | import static org.mockito.Mockito.*; |
26 | 27 | import static org.mockito.Mockito.anyLong; |
|
40 | 41 | import java.util.concurrent.CompletionStage; |
41 | 42 | import java.util.concurrent.TimeUnit; |
42 | 43 |
|
| 44 | +import org.junit.jupiter.api.Assertions; |
43 | 45 | import org.junit.jupiter.api.BeforeEach; |
44 | 46 | import org.junit.jupiter.api.Tag; |
45 | 47 | import org.junit.jupiter.api.Test; |
@@ -455,6 +457,20 @@ void shouldCloseConnections() { |
455 | 457 | verify(connection2).closeAsync(); |
456 | 458 | } |
457 | 459 |
|
| 460 | + /** |
| 461 | + * @see <a href="https://github.com/redis/lettuce/issues/3240">Issue link</a> |
| 462 | + */ |
| 463 | + @Test |
| 464 | + @org.junit.jupiter.api.Timeout(value = 5, unit = TimeUnit.SECONDS, threadMode = SEPARATE_THREAD) |
| 465 | + void shouldHandleInvalidUrisWithoutDeadlock() { |
| 466 | + List<RedisURI> seed = Arrays.asList(RedisURI.create("redis://localhost:$(INVALID_DATA):CONFIG"), |
| 467 | + RedisURI.create("redis://localhost:$(INVALID_DATA):CONFIG")); |
| 468 | + CompletionException completionException = Assertions.assertThrows(CompletionException.class, |
| 469 | + () -> sut.loadViews(seed, Duration.ofSeconds(1), true).toCompletableFuture().join()); |
| 470 | + assertThat(completionException) |
| 471 | + .hasRootCauseInstanceOf(DefaultClusterTopologyRefresh.CannotRetrieveClusterPartitions.class); |
| 472 | + } |
| 473 | + |
458 | 474 | @Test |
459 | 475 | void undiscoveredAdditionalNodesShouldBeLastUsingClientCount() { |
460 | 476 |
|
|
0 commit comments