|
23 | 23 | import io.r2dbc.postgresql.PostgresqlConnectionFactory;
|
24 | 24 | import io.r2dbc.postgresql.api.PostgresqlConnection;
|
25 | 25 | import io.r2dbc.postgresql.authentication.PasswordAuthenticationHandler;
|
26 |
| -import io.r2dbc.postgresql.message.Format; |
27 | 26 | import io.r2dbc.postgresql.message.backend.BackendMessage;
|
28 |
| -import io.r2dbc.postgresql.message.backend.BindComplete; |
29 | 27 | import io.r2dbc.postgresql.message.backend.CommandComplete;
|
30 | 28 | import io.r2dbc.postgresql.message.backend.DataRow;
|
31 | 29 | import io.r2dbc.postgresql.message.backend.NotificationResponse;
|
32 | 30 | import io.r2dbc.postgresql.message.backend.RowDescription;
|
33 |
| -import io.r2dbc.postgresql.message.frontend.Bind; |
34 |
| -import io.r2dbc.postgresql.message.frontend.Describe; |
35 |
| -import io.r2dbc.postgresql.message.frontend.Execute; |
36 |
| -import io.r2dbc.postgresql.message.frontend.ExecutionType; |
37 | 31 | import io.r2dbc.postgresql.message.frontend.FrontendMessage;
|
38 | 32 | import io.r2dbc.postgresql.message.frontend.Query;
|
39 |
| -import io.r2dbc.postgresql.message.frontend.Sync; |
40 | 33 | import io.r2dbc.postgresql.util.PostgresqlServerExtension;
|
41 | 34 | import io.r2dbc.spi.R2dbcNonTransientResourceException;
|
42 | 35 | import io.r2dbc.spi.R2dbcPermissionDeniedException;
|
|
60 | 53 | import java.io.File;
|
61 | 54 | import java.lang.reflect.Field;
|
62 | 55 | import java.time.Duration;
|
| 56 | +import java.time.temporal.ChronoUnit; |
63 | 57 | import java.util.Arrays;
|
64 | 58 | import java.util.Collections;
|
65 | 59 | import java.util.List;
|
|
70 | 64 | import java.util.function.Function;
|
71 | 65 | import java.util.stream.IntStream;
|
72 | 66 |
|
73 |
| -import static io.r2dbc.postgresql.codec.PostgresqlObjectId.INT4; |
74 | 67 | import static org.assertj.core.api.Assertions.assertThat;
|
75 | 68 | import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
|
76 | 69 | import static org.assertj.core.api.Assertions.fail;
|
@@ -342,6 +335,33 @@ void unixDomainSocketTest() {
|
342 | 335 | .verifyComplete();
|
343 | 336 | }
|
344 | 337 |
|
| 338 | + @Test |
| 339 | + @Timeout(10) |
| 340 | + void queryNeverCompletes() { |
| 341 | + PostgresqlConnectionFactory connectionFactory = new PostgresqlConnectionFactory(PostgresqlConnectionConfiguration.builder() |
| 342 | + .host(SERVER.getHost()) |
| 343 | + .port(SERVER.getPort()) |
| 344 | + .username(SERVER.getUsername()) |
| 345 | + .password(SERVER.getPassword()) |
| 346 | + .database(SERVER.getDatabase()) |
| 347 | + .applicationName(ReactorNettyClientIntegrationTests.class.getName()) |
| 348 | + .build()); |
| 349 | + Flux.usingWhen( |
| 350 | + connectionFactory.create(), |
| 351 | + connection -> connection.createStatement("SELECT floor(random() * 100) FROM generate_series(1, 256 + 15)").execute() |
| 352 | + .limitRate(1, 1) |
| 353 | + .flatMap(r -> r.map((row, meta) -> row.get(0)).limitRate(1, 1)) |
| 354 | + .limitRate(1, 1) |
| 355 | + .delayElements(Duration.of(1, ChronoUnit.MILLIS)) |
| 356 | + .limitRate(1, 1), |
| 357 | + io.r2dbc.spi.Connection::close |
| 358 | + ) |
| 359 | + .as(StepVerifier::create) |
| 360 | + .thenAwait() |
| 361 | + .expectNextCount(256 + 15) |
| 362 | + .verifyComplete(); |
| 363 | + } |
| 364 | + |
345 | 365 | public static class FailedVerification implements HostnameVerifier {
|
346 | 366 |
|
347 | 367 | @Override
|
|
0 commit comments