Repository: activemq-artemis
Updated Branches:
  refs/heads/master 7f0c9d022 -> 5a169013e


NO-JIRA fix AlignedJournalImplTest intermittent failure


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/5133e68e
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/5133e68e
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/5133e68e

Branch: refs/heads/master
Commit: 5133e68ea78d5e2af10df46edd281b293a8a06af
Parents: 81f89ae
Author: Justin Bertram <[email protected]>
Authored: Wed Feb 21 14:22:34 2018 -0600
Committer: Clebert Suconic <[email protected]>
Committed: Wed Feb 21 15:59:59 2018 -0500

----------------------------------------------------------------------
 .../tests/unit/core/journal/impl/AlignedJournalImplTest.java  | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/5133e68e/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/AlignedJournalImplTest.java
----------------------------------------------------------------------
diff --git 
a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/AlignedJournalImplTest.java
 
b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/AlignedJournalImplTest.java
index b85be80..517fcf0 100644
--- 
a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/AlignedJournalImplTest.java
+++ 
b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/AlignedJournalImplTest.java
@@ -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());

Reply via email to