jdeppe-pivotal commented on a change in pull request #5818:
URL: https://github.com/apache/geode/pull/5818#discussion_r541065181



##########
File path: 
geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/RedisStatsIntegrationTest.java
##########
@@ -468,33 +479,33 @@ public void 
NetworkKiloBytesReadOverLastSecond_shouldReturnCorrectData() {
 
   }
 
-
   // ######################### Clients Section 
#################################
 
   @Test
   public void clientsStat_withConnectAndClose_isCorrect() {
 
-    jedis = new Jedis("localhost", server.getPort(), TIMEOUT);
-    jedis.ping();
+    Jedis jedis2 = new Jedis("localhost", server.getPort(), TIMEOUT);
+    jedis2.ping();
 
-    assertThat(redisStats.getConnectedClients()).isEqualTo(1);
+    
assertThat(redisStats.getConnectedClients()).isEqualTo(preTestConnectedClients 
+ 1);
 
-    jedis.close();
+    jedis2.close();
     GeodeAwaitility.await().atMost(Duration.ofSeconds(2))
-        .untilAsserted(() -> 
assertThat(redisStats.getConnectedClients()).isEqualTo(0));
+        .untilAsserted(
+            () -> 
assertThat(redisStats.getConnectedClients()).isEqualTo(preTestConnectedClients));
   }
 
   @Test
   public void 
connectionsReceivedStat_shouldIncrement_WhenNewConnectionOccurs() {
 
-    jedis = new Jedis("localhost", server.getPort(), TIMEOUT);
-    jedis.ping();
+    Jedis jedis2 = new Jedis("localhost", server.getPort(), TIMEOUT);
+    jedis2.ping();
 
-    assertThat(redisStats.getConnectionsReceived()).isEqualTo(1);
+    
assertThat(redisStats.getConnectionsReceived()).isEqualTo(preTestConnectionsReceived
 + 1);
 
-    jedis.close();
+    jedis2.close();
 
-    assertThat(redisStats.getConnectionsReceived()).isEqualTo(1);
+    
assertThat(redisStats.getConnectionsReceived()).isEqualTo(preTestConnectionsReceived
 + 1);

Review comment:
       OK - got it. That does make sense. I think the test method name does 
make it clearer, but I wasn't paying close attention to that :/




----------------------------------------------------------------
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:
[email protected]


Reply via email to