Skip to content

Commit

Permalink
ARTEMIS-4215 Test adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
clebertsuconic committed May 26, 2023
1 parent 747e0bd commit 88f9fa4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ public void testValidateJournalOnRollbackSend() throws Exception {
// it should be max 10 actually, I'm just leaving some space for future changes,
// as the real test I'm after here is the broker should clean itself up
Wait.assertTrue(() -> fileFactory.listFiles("amq").size() <= 20);
Assert.assertTrue("there are too many files created", numberOfFiles <= 20);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import org.apache.activemq.artemis.api.core.management.QueueControl;
import org.apache.activemq.artemis.tests.soak.SoakTestBase;
import org.apache.activemq.artemis.tests.util.CFUtil;
import org.apache.activemq.artemis.tests.util.Wait;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
Expand Down Expand Up @@ -72,7 +73,7 @@ public void testInterruptJF() throws Throwable {

QueueControl queueControl = getQueueControl(liveURI, liveNameBuilder, queueName, queueName, RoutingType.ANYCAST, 5000);

Assert.assertEquals(messageCount, queueControl.getMessageCount());
Wait.assertEquals(messageCount, queueControl::getMessageCount, 5000);
Thread.sleep(100);

killProcess(serverProcess);
Expand All @@ -82,7 +83,7 @@ public void testInterruptJF() throws Throwable {
waitForServerToStart("tcp://localhost:61616", "artemis", "artemis", 5000);
queueControl = getQueueControl(liveURI, liveNameBuilder, queueName, queueName, RoutingType.ANYCAST, 5000);

Assert.assertEquals(messageCount, queueControl.getMessageCount());
Wait.assertEquals(messageCount, queueControl::getMessageCount);

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
import org.apache.activemq.artemis.utils.Env;
import org.apache.activemq.artemis.utils.ReusableLatch;
import org.apache.activemq.artemis.utils.Wait;
import org.junit.Assert;
import org.junit.Test;
import org.slf4j.Logger;
Expand Down Expand Up @@ -180,7 +181,7 @@ public void onError(int errorCode, String errorMessage) {

// simulating a low load period
timedBuffer.addBytes(buff, true, callback);
Thread.sleep(1000);
Thread.sleep(100);
timedBuffer.addBytes(buff, true, callback);
Assert.assertTrue(latchFlushed.await(5, TimeUnit.SECONDS));
latchFlushed.setCount(5);
Expand Down Expand Up @@ -494,9 +495,7 @@ public int getRemainingBytes() {
timedBuffer.checkSize(10);
timedBuffer.addBytes(buff, false, dummyCallback);

Thread.sleep(200);

Assert.assertEquals(count + 1, flushTimes.get());
Wait.assertEquals(count + 1, () -> flushTimes.get(), 2000);

bytes = new byte[10];
for (int j = 0; j < 10; j++) {
Expand Down

0 comments on commit 88f9fa4

Please sign in to comment.