geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jjra...@apache.org
Subject [geode] branch develop updated: GEODE-7461: Fix Flaky Test (#4334)
Date Mon, 18 Nov 2019 11:10:58 GMT
This is an automated email from the ASF dual-hosted git repository.

jjramos pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/develop by this push:
     new 18b1f4e  GEODE-7461: Fix Flaky Test (#4334)
18b1f4e is described below

commit 18b1f4ef51111926e25f5329c15d193d3b239ade
Author: Juan José Ramos <jujoramos@users.noreply.github.com>
AuthorDate: Mon Nov 18 11:10:26 2019 +0000

    GEODE-7461: Fix Flaky Test (#4334)
    
    - Fixed flakiness in DeltaSessionStatisticsIntegrationTest.
---
 .../internal/DeltaSessionStatisticsIntegrationTest.java     | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/extensions/geode-modules/src/integrationTest/java/org/apache/geode/modules/session/catalina/internal/DeltaSessionStatisticsIntegrationTest.java
b/extensions/geode-modules/src/integrationTest/java/org/apache/geode/modules/session/catalina/internal/DeltaSessionStatisticsIntegrationTest.java
index e279f31..81d59a7 100644
--- a/extensions/geode-modules/src/integrationTest/java/org/apache/geode/modules/session/catalina/internal/DeltaSessionStatisticsIntegrationTest.java
+++ b/extensions/geode-modules/src/integrationTest/java/org/apache/geode/modules/session/catalina/internal/DeltaSessionStatisticsIntegrationTest.java
@@ -20,8 +20,6 @@ import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.doCallRealMethod;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.spy;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
 import javax.servlet.http.HttpSession;
@@ -69,8 +67,8 @@ public class DeltaSessionStatisticsIntegrationTest extends AbstractDeltaSessionI
     when(deltaSessionManager.getSessionCache()).thenReturn(mockSessionCache);
 
     deltaSessionManager.add(new TestDeltaSession(deltaSessionManager, TEST_SESSION_ID));
-    await().untilAsserted(() -> assertThat(httpSessionRegion.isEmpty()).isFalse());
-    assertThat(statistics.getSessionsCreated()).isEqualTo(1);
+    await().untilAsserted(() -> assertThat(statistics.getSessionsCreated()).isEqualTo(1));
+    assertThat(httpSessionRegion.isEmpty()).isFalse();
   }
 
   @Test
@@ -87,9 +85,8 @@ public class DeltaSessionStatisticsIntegrationTest extends AbstractDeltaSessionI
     DeltaSession spyDeltasSession = spy(new TestDeltaSession(deltaSessionManager, TEST_SESSION_ID));
     httpSessionRegion.put(TEST_SESSION_ID, spyDeltasSession);
 
-    await().untilAsserted(() -> verify(spyDeltasSession, times(1)).processExpired());
+    await().untilAsserted(() -> assertThat(statistics.getSessionsExpired()).isEqualTo(1));
     assertThat(httpSessionRegion.isEmpty()).isTrue();
-    assertThat(statistics.getSessionsExpired()).isEqualTo(1);
   }
 
   @Test
@@ -105,8 +102,8 @@ public class DeltaSessionStatisticsIntegrationTest extends AbstractDeltaSessionI
     httpSessionRegion.put(deltaSession.getId(), deltaSession);
 
     deltaSession.invalidate();
-    await().untilAsserted(() -> assertThat(httpSessionRegion.isEmpty()).isTrue());
-    assertThat(statistics.getSessionsInvalidated()).isEqualTo(1);
+    await().untilAsserted(() -> assertThat(statistics.getSessionsInvalidated()).isEqualTo(1));
+    assertThat(httpSessionRegion.isEmpty()).isTrue();
   }
 
   static class TestCustomExpiry implements CustomExpiry<String, HttpSession> {


Mime
View raw message