pg.ddx.io  GitHub: pgjdbc/pgjdbc (issues + PRs as email threads)  
help / color / mirror / Atom feed
From: vlsi (@vlsi) <noreply+vlsi@github.com>
To: pgjdbc/pgjdbc <noreply+pgjdbc-pgjdbc@github.com>
Subject: Re: [pgjdbc/pgjdbc] PR #3964: feat: add tcpKeepAliveCount, tcpKeepAliveIdle and tcpKeepAliveInterval connection properties
Date: Wed, 09 Sep 2026 20:20:23 +0000
Message-ID: <gh-pgjdbc-pgjdbc-3964-rc3972654787@github.com> (raw)
In-Reply-To: <gh-pgjdbc-pgjdbc-3964@github.com>
References: <gh-pgjdbc-pgjdbc-3964@github.com>

(on pgjdbc/src/test/java/org/postgresql/test/jdbc2/ConnectionTest.java)

**The tests cannot fail where it matters.** Two separate problems.

1. On a Java 8 test run the java11 classes are not on the test classpath (`pgjdbc/build.gradle.kts` prepends `java11.output` only when `testJdkVersion >= 11`), the no-op accessor returns `false` for all three, and **all nine new assertions are skipped while both tests report green**. `java_version: '8'` is a live matrix value. Please use `assumeTrue(..., "reason")` so the report shows a skip with a reason rather than a pass — and gate on `socket.supportedOptions()` rather than on `isSupported()`, which is the predicate under discussion on the java11 implementation.

2. The expected values are read back through the same accessor that wrote them, so the most likely real defect — a name-to-option mapping that swaps `TCP_KEEPCOUNT` and `TCP_KEEPIDLE` — survives both tests. The oracle should be `java.net.Socket.getOption(...)` directly. Test sources compile with `--release 8`, so that needs a small reflective helper; I verified it compiles and works. While you are there, pick three values that differ from each other *and* from the platform defaults (8 / 7200 / 75), and give each assertion a message naming the option, since three bare `expected: <80> but was: <8>` lines do not say which one failed.

Missing cases: the JDK 8 refusal; an unsupported option on a JDK 11+ platform; `tcpKeepAlive=false` with the three set; negative, zero, `Integer.MAX_VALUE` and non-numeric values; `PGProperty.setInteger(props, null)` removing the key. Most of those need no server — `ExtendedSocketOptionAccessorImpl` is fully observable against a loopback `ServerSocket` in one process, and `pgjdbc/src/test/java/org/postgresql/core/` already hosts server-free tests, so an `ExtendedSocketOptionAccessorImplTest` there would be the right home.

view thread (85+ messages)  latest in thread

Message-ID: <gh-pgjdbc-pgjdbc-3964-rc3972654787@github.com>
Permalink:  ../gh-pgjdbc-pgjdbc-3964-rc3972654787@github.com/

 · 


This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox