You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2020/07/01 06:33:19 UTC

[GitHub] [beam] ajamato commented on a change in pull request #12137: [BEAM-10392] Attempt to fix/enable detection of rabbitmq:test stuckness.

ajamato commented on a change in pull request #12137:
URL: https://github.com/apache/beam/pull/12137#discussion_r448143856



##########
File path: sdks/java/io/rabbitmq/src/test/java/org/apache/beam/sdk/io/rabbitmq/RabbitMqIOTest.java
##########
@@ -396,18 +394,18 @@ public void testWriteQueue() throws Exception {
       connection = connectionFactory.newConnection();
       channel = connection.createChannel();
       channel.queueDeclare("TEST", true, false, false, null);
-      Consumer consumer = new RabbitMqTestUtils.TestConsumer(channel, received);
+      RabbitMqTestUtils.TestConsumer consumer = new RabbitMqTestUtils.TestConsumer(channel);
       channel.basicConsume("TEST", true, consumer);
 
       p.run();
 
-      while (received.size() < maxNumRecords) {
+      while (consumer.getReceived().size() < maxNumRecords) {
         Thread.sleep(500);
       }
 
-      assertEquals(maxNumRecords, received.size());
+      assertEquals(maxNumRecords, consumer.getReceived().size());

Review comment:
       nit: I doubt this matters because you only add elements to the received list. but might be safer style to use the same reference instead of calling getReceived() 3 times. Which ensures the exact same snapshot. Up to you if you want to change it.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org