~pbeaman/akiban-persistit/fix-1126297-longer-briefwait

« back to all changes in this revision

Viewing changes to src/test/java/com/persistit/ExchangeLockTest.java

merge pbeaman: Fixes bug in which a IT record was written to the journal for a tree in the temporary lock volume.

https://code.launchpad.net/~pbeaman/akiban-persistit/fix-1125603-lock-tree-in-journal/+merge/148755

Show diffs side-by-side

added added

removed removed

Lines of Context:
314
314
        final long interval = end - start;
315
315
        assertTrue("Should have waited about 1 second", interval >= 1000 && interval < 2000);
316
316
    }
 
317
 
 
318
    @Test
 
319
    public void bug1125603test() throws Exception {
 
320
        final Exchange ex = _persistit.getExchange("persistit", "ExchangeLockTest", true);
 
321
        final Transaction txn = ex.getTransaction();
 
322
        txn.begin();
 
323
        try {
 
324
            ex.append("motor");
 
325
            ex.lock();
 
326
            txn.commit();
 
327
        } catch (final Exception e) {
 
328
            e.printStackTrace();
 
329
        } finally {
 
330
            txn.end();
 
331
        }
 
332
        _persistit.getJournalManager().rolloverWithNewFile();
 
333
        _persistit.checkpoint();
 
334
        _persistit.close();
 
335
        _persistit = new Persistit(_config);
 
336
        _persistit.initialize();
 
337
    }
317
338
}