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