[ 
https://issues.apache.org/jira/browse/GEODE-8370?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17162157#comment-17162157
 ] 

ASF GitHub Bot commented on GEODE-8370:
---------------------------------------

sabbeyPivotal commented on a change in pull request #5385:
URL: https://github.com/apache/geode/pull/5385#discussion_r458229811



##########
File path: 
geode-redis/src/distributedTest/java/org/apache/geode/redis/session/SessionExpirationDUnitTest.java
##########
@@ -86,15 +100,78 @@ public void 
sessionShouldTimeout_whenAppFailsOverToAnotherRedisServer() {
     }
   }
 
+  @Test
+  public void sessionShouldNotTimeout_whenPersisted() {
+    String sessionCookie = createNewSessionWithNote(APP2, "note1");
+    setMaxInactiveInterval(APP2, sessionCookie, -1);
+
+    compareMaxInactiveIntervals();
+  }
+
   private void waitForTheSessionToExpire(String sessionId) {
     GeodeAwaitility.await().ignoreExceptions().atMost((SHORT_SESSION_TIMEOUT + 
5), TimeUnit.SECONDS)
         .until(
-            () -> 
jedisConnetedToServer1.ttl("spring:session:sessions:expires:" + sessionId) < 0);
+            () -> 
jedisConnetedToServer1.ttl("spring:session:sessions:expires:" + sessionId) == 
-2);
   }
 
   private void refreshSession(String sessionCookie, int sessionApp) {
     GeodeAwaitility.await()
         .during(SHORT_SESSION_TIMEOUT + 2, TimeUnit.SECONDS)
         .until(() -> getSessionNotes(sessionApp, sessionCookie) != null);
   }
+
+  void setMaxInactiveInterval(int sessionApp, String sessionCookie, int 
maxInactiveInterval) {
+    HttpHeaders requestHeaders = new HttpHeaders();
+    requestHeaders.add("Cookie", sessionCookie);
+    HttpEntity<Integer> request = new HttpEntity<>(maxInactiveInterval, 
requestHeaders);
+    new RestTemplate()
+        .postForEntity(
+            "http://localhost:"; + ports.get(sessionApp) + 
"/setMaxInactiveInterval",
+            request,
+            Integer.class)
+        .getHeaders();
+  }
+
+  private void compareMaxInactiveIntervals() {
+    cluster.getVM(1).invoke(() -> {
+      for (int j = 0; j < 113; j++) {

Review comment:
       Good suggestion! Just updated 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:
us...@infra.apache.org


> Add test for maxInactiveInterval
> --------------------------------
>
>                 Key: GEODE-8370
>                 URL: https://issues.apache.org/jira/browse/GEODE-8370
>             Project: Geode
>          Issue Type: Test
>          Components: redis, tests
>            Reporter: Sarah Abbey
>            Priority: Major
>              Labels: pull-request-available
>
> Write test verifying that maxInactiveInterval propagates correctly to all 
> buckets



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to