Skip to content

Commit

Permalink
Fix error tests, producer should wait a while for consumer to be ready
Browse files Browse the repository at this point in the history
  • Loading branch information
dongeforever committed Jun 6, 2017
1 parent 2f351c9 commit 0c5e53d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ public void tearDown() {
}

@Test
public void testNotConsumeAfterConsume() {
public void testNotConsumeAfterConsume() throws Exception {
int msgSize = 16;

String group = initConsumerGroup();
RMQBroadCastConsumer consumer1 = getBroadCastConsumer(nsAddr, group, topic, "*",
new RMQNormalListner(group + "_1"));

Thread.sleep(3000);
producer.send(msgSize);
Assert.assertEquals("Not all sent succeeded", msgSize, producer.getAllUndupMsgBody().size());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ public MessageQueue select(List<MessageQueue> list, Message message, Object o) {

producer.clearMsg();
consumer.clearMsg();
producer.getSuccessSendResult().clear();

producer.asyncSend(msgSize, new MessageQueueSelector() {
@Override
Expand Down

0 comments on commit 0c5e53d

Please sign in to comment.