mirror of
https://github.com/apache/activemq-artemis.git
synced 2025-02-24 11:30:47 +00:00
NO-JIRA Limiting load on NIOJournalCompactTest
This test is boundless adding data into the journal when there are no syncs. That's creating 600MIB worth of data on our CIs, and this tests was not meant to be acting like a soak test. I'm limitting the load the test can generate with a TokenBucketLimiterImpl now.
This commit is contained in:
parent
2fcb24ea30
commit
6de9e30c46
@ -57,6 +57,8 @@ import org.apache.activemq.artemis.tests.unit.core.journal.impl.fakes.SimpleEnco
|
|||||||
import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
|
import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
|
||||||
import org.apache.activemq.artemis.utils.ActiveMQThreadFactory;
|
import org.apache.activemq.artemis.utils.ActiveMQThreadFactory;
|
||||||
import org.apache.activemq.artemis.utils.IDGenerator;
|
import org.apache.activemq.artemis.utils.IDGenerator;
|
||||||
|
import org.apache.activemq.artemis.utils.TokenBucketLimiter;
|
||||||
|
import org.apache.activemq.artemis.utils.TokenBucketLimiterImpl;
|
||||||
import org.apache.activemq.artemis.utils.actors.OrderedExecutorFactory;
|
import org.apache.activemq.artemis.utils.actors.OrderedExecutorFactory;
|
||||||
import org.apache.activemq.artemis.utils.SimpleIDGenerator;
|
import org.apache.activemq.artemis.utils.SimpleIDGenerator;
|
||||||
import org.apache.activemq.artemis.utils.critical.EmptyCriticalAnalyzer;
|
import org.apache.activemq.artemis.utils.critical.EmptyCriticalAnalyzer;
|
||||||
@ -2017,8 +2019,10 @@ public class NIOJournalCompactTest extends JournalImplTestBase {
|
|||||||
Runnable producerRunnable = new Runnable() {
|
Runnable producerRunnable = new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
TokenBucketLimiter limiter = new TokenBucketLimiterImpl(5000, true);
|
||||||
try {
|
try {
|
||||||
while (running.get()) {
|
while (running.get()) {
|
||||||
|
limiter.limit();
|
||||||
final long[] values = new long[100];
|
final long[] values = new long[100];
|
||||||
long tx = seqGenerator.incrementAndGet();
|
long tx = seqGenerator.incrementAndGet();
|
||||||
|
|
||||||
@ -2104,7 +2108,7 @@ public class NIOJournalCompactTest extends JournalImplTestBase {
|
|||||||
Thread compactorThread = new Thread(compressRunnable);
|
Thread compactorThread = new Thread(compressRunnable);
|
||||||
compactorThread.start();
|
compactorThread.start();
|
||||||
|
|
||||||
Thread.sleep(1000);
|
Thread.sleep(500);
|
||||||
|
|
||||||
running.set(false);
|
running.set(false);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user