speed up this test and improve logging in the event of failure

This commit is contained in:
gtully 2014-03-19 15:32:10 +00:00
parent 89446c7af0
commit 2efb6df619
1 changed files with 3 additions and 1 deletions

View File

@ -83,10 +83,11 @@ public class DurableSubSelectorDelayWithRestartTest {
}
final KahaDBPersistenceAdapter pa = (KahaDBPersistenceAdapter) broker.getPersistenceAdapter();
assertTrue("only one journal file should be left ", Wait.waitFor(new Wait.Condition() {
assertTrue("small number of journal files should be left ", Wait.waitFor(new Wait.Condition() {
@Override
public boolean isSatisified() throws Exception {
LOG.info("journal data file count - expected {} actual {}", 4, pa.getStore().getJournal().getFileMap().size());
return pa.getStore().getJournal().getFileMap().size() < 4;
}
}, TimeUnit.MINUTES.toMillis(3)));
@ -299,6 +300,7 @@ public class DurableSubSelectorDelayWithRestartTest {
KahaDBPersistenceAdapter kahadb = new KahaDBPersistenceAdapter();
kahadb.setDirectory(kahadbData);
kahadb.setJournalMaxFileLength( 10 * 1024);
kahadb.setCleanupInterval(5000);
broker.setPersistenceAdapter(kahadb);
broker.addConnector("tcp://localhost:61656");