[hibernate-dev] Testing DB lock timeouts

Radim Vansa rvansa at redhat.com
Tue Dec 13 12:20:54 EST 2016


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

More information about the hibernate-dev mailing list