[hibernate-dev] Testing DB lock timeouts
steve at hibernate.org
Tue Dec 13 13:55:09 EST 2016
ConnectionProvider mocking the Connection?
To help there is org.hibernate.testing.jdbc.JdbcMocks
On Tue, Dec 13, 2016 at 11:23 AM Radim Vansa <rvansa at redhat.com> wrote:
> since hibernate-infinispan testsuite has been set on by default,
> recently I've set myself to improve the execution time which is several
> minutes due to various sleeps and timeouts.
> Many of the tests test concurrency issues, and that often involves
> issuing two writes to single table/row in DB. In H2, this results in
> waiting 10 seconds (as configured default lock timeout), and since the
> tests are executed sequentially, the testsuite takes much longer than it
> Obvious workaround is reducing this timeout to, say, 100 ms, but this
> could lead to a) false positives and b) those 100 ms add up and with
> over thousand of tests (for various configurations), this could be
> minutes anyway.
> Q: is there any infrastructure in testsuite to hook into the DB, assert
> that it's waiting in lock and let the thread time out if everything is
> as expected?
> Radim Vansa <rvansa at redhat.com>
> JBoss Performance Team
> hibernate-dev mailing list
> hibernate-dev at lists.jboss.org
More information about the hibernate-dev