Skip to content

Commit a4e49c5

Browse files
committed
reduce network communication cost for pg pool test so that it does not timeout
Signed-off-by: Billy Yuan <billy112487983@gmail.com>
1 parent 03a49ff commit a4e49c5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

vertx-pg-client/src/test/java/io/vertx/pgclient/PgPoolTestBase.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ public void testPool(TestContext ctx) {
6060
PgPool pool = createPool(options, 4);
6161
for (int i = 0;i < num;i++) {
6262
pool.getConnection(ctx.asyncAssertSuccess(conn -> {
63-
conn.query("SELECT id, randomnumber from WORLD").execute(ar -> {
63+
conn.query("SELECT id, randomnumber from WORLD WHERE id = 1").execute(ar -> {
6464
if (ar.succeeded()) {
6565
SqlResult result = ar.result();
66-
ctx.assertEquals(10000, result.size());
66+
ctx.assertEquals(1, result.size());
6767
} else {
6868
ctx.assertEquals("closed", ar.cause().getMessage());
6969
}
@@ -80,10 +80,10 @@ public void testQuery(TestContext ctx) {
8080
Async async = ctx.async(num);
8181
PgPool pool = createPool(options, 4);
8282
for (int i = 0;i < num;i++) {
83-
pool.query("SELECT id, randomnumber from WORLD").execute(ar -> {
83+
pool.query("SELECT id, randomnumber from WORLD WHERE id = 1").execute(ar -> {
8484
if (ar.succeeded()) {
8585
SqlResult result = ar.result();
86-
ctx.assertEquals(10000, result.size());
86+
ctx.assertEquals(1, result.size());
8787
} else {
8888
ctx.assertEquals("closed", ar.cause().getMessage());
8989
}

0 commit comments

Comments
 (0)