From 7facd28a18e225063a7bb13d54172b7dc2ec9feb Mon Sep 17 00:00:00 2001 From: Clebert Suconic Date: Sun, 23 Apr 2017 22:12:23 -0400 Subject: [PATCH] NO-JIRA: Trivial test fix --- .../tests/unit/core/journal/impl/JournalImplTestUnit.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/JournalImplTestUnit.java b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/JournalImplTestUnit.java index 39507aa216..50ad154086 100644 --- a/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/JournalImplTestUnit.java +++ b/tests/unit-tests/src/test/java/org/apache/activemq/artemis/tests/unit/core/journal/impl/JournalImplTestUnit.java @@ -978,7 +978,13 @@ public abstract class JournalImplTestUnit extends JournalImplTestBase { add(i); } - Assert.assertEquals(calculateNumberOfFiles(journal, fileSize, journal.getAlignment(), 200, recordLength, 200, JournalImpl.SIZE_DELETE_RECORD_TX, 1, JournalImpl.SIZE_COMMIT_RECORD, 10, JournalImpl.SIZE_ADD_RECORD + recordLength), journal.getDataFilesCount()); + int files = calculateNumberOfFiles(journal, fileSize, journal.getAlignment(), 200, recordLength, 200, JournalImpl.SIZE_DELETE_RECORD_TX, 1, JournalImpl.SIZE_COMMIT_RECORD, 10, JournalImpl.SIZE_ADD_RECORD + recordLength); + + for (int i = 0; i < 100 && journal.getDataFilesCount() != files; i++) { + Thread.sleep(10); + } + + Assert.assertEquals(files, journal.getDataFilesCount()); Assert.assertEquals(0, journal.getFreeFilesCount()); Assert.assertEquals(10, journal.getIDMapSize());