You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by GitBox <gi...@apache.org> on 2020/09/25 16:00:33 UTC

[GitHub] [geode] jhutchison commented on a change in pull request #5552: GEODE-8538: Create test to validate ordering of redis pipeline commands

jhutchison commented on a change in pull request #5552:
URL: https://github.com/apache/geode/pull/5552#discussion_r495085108



##########
File path: geode-redis/src/integrationTest/java/org/apache/geode/redis/CommandPipeliningIntegrationTest.java
##########
@@ -93,6 +98,42 @@ public void whenPipelining_commandResponsesAreNotCorrupted() {
     assertThat(mockSubscriber.getReceivedMessages()).isEqualTo(expectedMessages);
   }
 
+
+  @Test
+  public void should_returnResultsOfPipelinedCommands_inCorrectOrder() {
+    Logger logger = LogManager.getLogger("org.apache.geode.redis.internal");
+    Configurator.setAllLevels(logger.getName(), Level.getLevel("DEBUG"));
+    FastLogger.setDelegating(true);
+
+    Jedis jedis = new Jedis("localhost", server.getPort(), 10000000);
+    int NUMBER_OF_COMMANDS_IN_PIPELINE = 100;
+    int numberOfPipeLineRequests = 1000;
+
+    do {
+      Pipeline p = jedis.pipelined();
+      for (int i = 0; i < NUMBER_OF_COMMANDS_IN_PIPELINE; i++) {
+        p.echo(String.valueOf(i));
+      }
+
+      List<Object> results = p.syncAndReturnAll();
+
+      verifyResultOrder(NUMBER_OF_COMMANDS_IN_PIPELINE, results);
+      numberOfPipeLineRequests--;
+    } while (numberOfPipeLineRequests > 0);
+
+    jedis.flushAll();
+    jedis.close();
+  }
+
+  private void verifyResultOrder(int NUMBER_OF_COMMAND_IN_PIPELINE, List<Object> results) {

Review comment:
       made final.  Thanks!




----------------------------------------------------------------
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