HHH-5025: waiting max 3 seconds for the cache to be written to disk

This commit is contained in:
adamw 2011-06-02 07:52:30 +02:00
parent 0a55292b7c
commit 0c9a55d33c
1 changed files with 9 additions and 3 deletions

View File

@ -51,9 +51,15 @@ 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);
} }