HHH-5025: waiting max 3 seconds for the cache to be written to disk
This commit is contained in:
parent
dde40660b8
commit
af4a14eac1
|
@ -51,8 +51,14 @@ public class HibernateSecLvlQueryCache extends AbstractSessionTest {
|
||||||
.add(new RevisionTypeAuditExpression(RevisionType.ADD, "="))
|
.add(new RevisionTypeAuditExpression(RevisionType.ADD, "="))
|
||||||
.setCacheable(true).setCacheRegion(QUERY_CACHE_REGION).getResultList();
|
.setCacheable(true).setCacheRegion(QUERY_CACHE_REGION).getResultList();
|
||||||
|
|
||||||
// Waiting for cached data to persist to disk.
|
// Waiting max 3 seconds for cached data to persist to disk.
|
||||||
Thread.sleep(1000);
|
for (int i=0; i<30; i++) {
|
||||||
|
if (getQueryCacheSize() > 0) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
Thread.sleep(100);
|
||||||
|
}
|
||||||
|
|
||||||
Assert.assertTrue(getQueryCacheSize() > 0);
|
Assert.assertTrue(getQueryCacheSize() > 0);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue