ARTEMIS-4215 Test adjustments

This commit is contained in:
Clebert Suconic 2023-05-24 17:13:01 -04:00
parent 747e0bd1e4
commit 88f9fa494b
3 changed files with 6 additions and 7 deletions

View File

@ -146,7 +146,6 @@ public class InfiniteRedeliverySmokeTest extends SmokeTestBase {
// 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);
}
}
}

View File

@ -30,6 +30,7 @@ import org.apache.activemq.artemis.api.core.management.ObjectNameBuilder;
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;
@ -72,7 +73,7 @@ public class JournalFlushInterruptTest extends SoakTestBase {
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);
@ -82,7 +83,7 @@ public class JournalFlushInterruptTest extends SoakTestBase {
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);
}

View File

@ -34,6 +34,7 @@ import org.apache.activemq.artemis.core.journal.EncodingSupport;
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;
@ -180,7 +181,7 @@ public class TimedBufferTest extends ActiveMQTestBase {
// 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);
@ -494,9 +495,7 @@ public class TimedBufferTest extends ActiveMQTestBase {
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++) {