Hi Nick,
How disappointing that Oracle's implementation of isValid() is actually less efficient than a query. The whole idea of the isValid() method was so that vendors could, for example, implement an "is valid" check by simple bouncing a packet between the client and server rather than executing a SQL statement that goes all the way through the database stack (parser, optimizer, execution plan, etc.). I have no idea what Oracle is doing under the covers, but if "SELECT * FROM DUAL" is empirically faster, I would suggest using that rather then the isValid() method, though I would propose "SELECT 1 FROM DUAL" instead. Having said that, 8ms is an extremely long time for such a query. Well tuned Oracle configurations and networking stacks should run queries like this in the 1-2ms range.
Re: background testing and the 1000ms "exception" to the alive check. HikariCP is designed for high-performance, but not at the cost of reliability. We will gladly perform slower in some environments in order to ensure fewer application-level errors. Having said that, one of HikariCP's main design targets are highly active applications -- applications that sustain hundreds or thousands of transactions per minute. HikariCP treats connections that have been used reliably within the past second as "proven" -- this is the <1000ms exception.
Once you start pushing this out to several seconds, or in the case of pools like tomcat, bonecp, dbcp, pushing it out to 30 seconds, you start to trade off reliability. Having a thread (or threads) that tests connections every 30 seconds is pretty worthless in our opinion. For example, this means is that if the database is rebooted, even if it comes back up in 5 seconds the pool can continue returning bad connections for the next 30 seconds.
Anyway, try "SELECT 1 FROM DUAL", and poke around how to tune your Oracle config and equally important your TCP stacks. You should be able to get "SELECT 1 FROM DUAL" down to about 2ms.