geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From u..@apache.org
Subject incubator-geode git commit: GEODE-1594: Reduced iteration counts of actions and removed unnecessary CacheFactory invocation
Date Wed, 30 Nov 2016 23:47:20 GMT
Repository: incubator-geode
Updated Branches:
  refs/heads/develop f0e5159c2 -> 890e6c784


GEODE-1594: Reduced iteration counts of actions and removed unnecessary CacheFactory invocation


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/890e6c78
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/890e6c78
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/890e6c78

Branch: refs/heads/develop
Commit: 890e6c784756e0076d9b1858c07d2a233ab95b27
Parents: f0e5159
Author: Udo Kohlmeyer <ukohlmeyer@pivotal.io>
Authored: Wed Nov 30 15:46:30 2016 -0800
Committer: Udo Kohlmeyer <ukohlmeyer@pivotal.io>
Committed: Wed Nov 30 15:46:30 2016 -0800

----------------------------------------------------------------------
 .../web/controllers/RestAPITestBase.java        | 10 +++++-----
 ...APIsOnMembersFunctionExecutionDUnitTest.java | 21 ++++++--------------
 2 files changed, 11 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/890e6c78/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/RestAPITestBase.java
----------------------------------------------------------------------
diff --git a/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/RestAPITestBase.java
b/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/RestAPITestBase.java
index b1b490e..68555bc 100644
--- a/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/RestAPITestBase.java
+++ b/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/RestAPITestBase.java
@@ -56,11 +56,11 @@ import org.apache.geode.test.junit.categories.DistributedTest;
 class RestAPITestBase extends JUnit4DistributedTestCase {
 
   protected Cache cache = null;
-  List<String> restURLs = new ArrayList<>();
-  VM vm0 = null;
-  VM vm1 = null;
-  VM vm2 = null;
-  VM vm3 = null;
+  protected List<String> restURLs = new ArrayList<>();
+  protected VM vm0 = null;
+  protected VM vm1 = null;
+  protected VM vm2 = null;
+  protected VM vm3 = null;
 
   @Override
   public final void postSetUp() throws Exception {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/890e6c78/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/RestAPIsOnMembersFunctionExecutionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/RestAPIsOnMembersFunctionExecutionDUnitTest.java
b/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/RestAPIsOnMembersFunctionExecutionDUnitTest.java
index 3907bfc..7528bff 100644
--- a/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/RestAPIsOnMembersFunctionExecutionDUnitTest.java
+++ b/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/RestAPIsOnMembersFunctionExecutionDUnitTest.java
@@ -59,15 +59,7 @@ public class RestAPIsOnMembersFunctionExecutionDUnitTest extends RestAPITestBase
     props.setProperty(HTTP_SERVICE_BIND_ADDRESS, hostName);
     props.setProperty(HTTP_SERVICE_PORT, String.valueOf(servicePort));
 
-    Cache c = null;
-    try {
-      c = CacheFactory
-          .getInstance(new RestAPIsOnMembersFunctionExecutionDUnitTest().getSystem(props));
-      c.close();
-    } catch (CacheClosedException ignore) {
-    }
-
-    c = CacheFactory.create(new RestAPIsOnMembersFunctionExecutionDUnitTest().getSystem(props));
+    CacheFactory.create(new RestAPIsOnMembersFunctionExecutionDUnitTest().getSystem(props));
     FunctionService.registerFunction(new OnMembersFunction());
 
     return "http://" + hostName + ":" + servicePort + urlContext + "/v1";
@@ -80,17 +72,16 @@ public class RestAPIsOnMembersFunctionExecutionDUnitTest extends RestAPITestBase
   }
 
   @Test
-  @Category(FlakyTest.class) // GEODE-1594 HTTP server fails to respond
   public void testFunctionExecutionOnAllMembers() {
     createCacheForVMs();
 
-    for (int i = 0; i < 10; i++) {
+    for (int i = 0; i < 5; i++) {
       CloseableHttpResponse response =
           executeFunctionThroughRestCall("OnMembersFunction", null, null, null, null, null);
       assertHttpResponse(response, 200, 4);
     }
 
-    assertCorrectInvocationCount(40, vm0, vm1, vm2, vm3);
+    assertCorrectInvocationCount(20, vm0, vm1, vm2, vm3);
 
     restURLs.clear();
   }
@@ -110,13 +101,13 @@ public class RestAPIsOnMembersFunctionExecutionDUnitTest extends RestAPITestBase
   public void testFunctionExecutionEOnSelectedMembers() {
     createCacheForVMs();
 
-    for (int i = 0; i < 10; i++) {
+    for (int i = 0; i < 5; i++) {
       CloseableHttpResponse response =
           executeFunctionThroughRestCall("OnMembersFunction", null, null, null, null, "m1,m2,m3");
       assertHttpResponse(response, 200, 3);
     }
 
-    assertCorrectInvocationCount(30, vm0, vm1, vm2, vm3);
+    assertCorrectInvocationCount(15, vm0, vm1, vm2, vm3);
 
     restURLs.clear();
   }
@@ -125,7 +116,7 @@ public class RestAPIsOnMembersFunctionExecutionDUnitTest extends RestAPITestBase
   public void testFunctionExecutionOnMembersWithFilter() {
     createCacheForVMs();
 
-    for (int i = 0; i < 10; i++) {
+    for (int i = 0; i < 5; i++) {
       CloseableHttpResponse response =
           executeFunctionThroughRestCall("OnMembersFunction", null, "key2", null, null, "m1,m2,m3");
       assertHttpResponse(response, 500, 0);


Mime
View raw message