Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixing test

  • Loading branch information...
commit fc3ca9d5cd318fd1844babac45f384cd947353c5 1 parent 109dcc8
@clebertsuconic clebertsuconic authored
View
26 tests/src/org/hornetq/tests/stress/journal/MultiThreadConsumerStressTest.java
@@ -69,6 +69,18 @@ public void testProduceAndConsume() throws Throwable
int consumeMessage = (int) (produceMessage * 0.9);
int commitIntervalConsume = 100;
+ ClientSession session = sf.createSession(false, false);
+ session.createQueue("compact", "compact-queue", true);
+
+ ClientProducer producer = session.createProducer("compact");
+
+ for (int i = 0 ; i < 100; i++)
+ {
+ producer.send(session.createClientMessage(true));
+ }
+
+ session.commit();
+
// Number of messages expected to be received after restart
int numberOfMessagesExpected = (produceMessage - consumeMessage) * numberOfConsumers;
@@ -123,9 +135,9 @@ public void testProduceAndConsume() throws Throwable
ClientMessage msg = consumer.receive(5000);
assertNotNull(msg);
- if (i % 100 == 0)
+ if (i % 1000 == 0)
{
- System.out.println("Received #" + i + " on thread after start");
+ System.out.println("Received #" + i + " on thread before end");
}
msg.acknowledge();
}
@@ -165,7 +177,7 @@ private void setupServer(JournalType journalType) throws Exception, HornetQExcep
config.setJournalFileSize(ConfigurationImpl.DEFAULT_JOURNAL_FILE_SIZE);
config.setJournalMinFiles(ConfigurationImpl.DEFAULT_JOURNAL_MIN_FILES);
- config.setJournalCompactMinFiles(0);
+ config.setJournalCompactMinFiles(2);
config.setJournalCompactPercentage(50);
server = createServer(true, config);
@@ -254,9 +266,9 @@ public void run()
{
session.commit();
}
- if (i % 100 == 0)
+ if (i % 1000 == 0)
{
- System.out.println(Thread.currentThread().getName() + "::received #" + i);
+ //System.out.println(Thread.currentThread().getName() + "::received #" + i);
}
ClientMessage msg = session.createClientMessage(true);
prod.send(msg);
@@ -314,9 +326,9 @@ public void run()
{
session.commit();
}
- if (i % 100 == 0)
+ if (i % 1000 == 0)
{
- System.out.println(Thread.currentThread().getName() + "::sent #" + i);
+ //System.out.println(Thread.currentThread().getName() + "::sent #" + i);
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.