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 15:51:19 UTC

[GitHub] [geode] jhutchison opened a new pull request #5552: GEODE-8538: Create test to validate ordering of redis pipeline commands

jhutchison opened a new pull request #5552:
URL: https://github.com/apache/geode/pull/5552


   Thank you for submitting a contribution to Apache Geode.
   
   In order to streamline the review of the contribution we ask you
   to ensure the following steps have been taken:
   
   ### For all changes:
   - [ ] Is there a JIRA ticket associated with this PR? Is it referenced in the commit message?
   
   - [ ] Has your PR been rebased against the latest commit within the target branch (typically `develop`)?
   
   - [ ] Is your initial contribution a single, squashed commit?
   
   - [ ] Does `gradlew build` run cleanly?
   
   - [ ] Have you written or updated unit tests to verify your changes?
   
   - [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)?
   
   ### Note:
   Please ensure that once the PR is submitted, check Concourse for build issues and
   submit an update to your PR as soon as possible. If you need help, please send an
   email to dev@geode.apache.org.
   


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



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

Posted by GitBox <gi...@apache.org>.
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



[GitHub] [geode] sabbey37 merged pull request #5552: GEODE-8538: Create test to validate ordering of redis pipeline commands

Posted by GitBox <gi...@apache.org>.
sabbey37 merged pull request #5552:
URL: https://github.com/apache/geode/pull/5552


   


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



[GitHub] [geode] jdeppe-pivotal commented on pull request #5552: GEODE-8538: Create test to validate ordering of redis pipeline commands

Posted by GitBox <gi...@apache.org>.
jdeppe-pivotal commented on pull request #5552:
URL: https://github.com/apache/geode/pull/5552#issuecomment-700892050


   I think the changes need to be rebased onto develop to avoid some of the strange junit failures.


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



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

Posted by GitBox <gi...@apache.org>.
ringles commented on a change in pull request #5552:
URL: https://github.com/apache/geode/pull/5552#discussion_r495082332



##########
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:
       NUMBER_OF_COMMAND_IN_PIPELINE looks like a constant, but isn't. It should be something like "numberOfCommands" or "numberOfCommandsInPipeline".




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