This commit is contained in:
Clebert Suconic 2018-02-21 16:00:00 -05:00
commit 5a169013e7
2 changed files with 10 additions and 1 deletions

View File

@ -1,7 +1,11 @@
sudo: false
language: java
install: true
# use 'install' so smoke-tests will work
# use '-Pextra-tests' to ensure extra-tests compiles even though they won't actually run
script: mvn -Pfast-tests -Pextra-tests -B install
cache:
directories:
- $HOME/.m2

View File

@ -33,6 +33,7 @@ import org.apache.activemq.artemis.core.journal.PreparedTransactionInfo;
import org.apache.activemq.artemis.core.journal.RecordInfo;
import org.apache.activemq.artemis.core.journal.TransactionFailureCallback;
import org.apache.activemq.artemis.core.journal.impl.JournalImpl;
import org.apache.activemq.artemis.junit.Wait;
import org.apache.activemq.artemis.tests.unit.UnitTestLogger;
import org.apache.activemq.artemis.tests.unit.core.journal.impl.fakes.FakeSequentialFileFactory;
import org.apache.activemq.artemis.tests.unit.core.journal.impl.fakes.SimpleEncoding;
@ -998,10 +999,11 @@ public class AlignedJournalImplTest extends ActiveMQTestBase {
@Test
public void testReclaimAfterRollabck() throws Exception {
final int JOURNAL_SIZE = 2000;
final int COUNT = 10;
setupAndLoadJournal(JOURNAL_SIZE, 1);
for (int i = 0; i < 10; i++) {
for (int i = 0; i < COUNT; i++) {
journalImpl.appendAddRecordTransactional(1L, i, (byte) 0, new SimpleEncoding(1, (byte) 0));
journalImpl.forceMoveNextFile();
}
@ -1010,6 +1012,9 @@ public class AlignedJournalImplTest extends ActiveMQTestBase {
journalImpl.forceMoveNextFile();
// wait for the previous call to forceMoveNextFile() to complete
assertTrue(Wait.waitFor(() -> factory.listFiles("tt").size() == COUNT + 3, 2000, 50));
journalImpl.checkReclaimStatus();
Assert.assertEquals(0, journalImpl.getDataFilesCount());