BasicTransactionalTestCase.testQueryCache and testQueryCacheHitInSameTransaction are randomly giving failures due to persist and queries happening within 100ms, which the update timestamps considers the cache query results not to be up to date. Adding a small delay in between persist and query to get around this issue.
The underlying problem of persist/query false misses has been discussed in a couple of previous occasions, see: http://lists.jboss.org/pipermail/hibernate-dev/2010-January/004744.html
and are related to this.
Bulk closing stale resolved issues