geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bschucha...@apache.org
Subject [geode] 01/01: GEODE-7489 DistributionArchUnitTest is running out of memory for some users
Date Tue, 26 Nov 2019 18:57:32 GMT
This is an automated email from the ASF dual-hosted git repository.

bschuchardt pushed a commit to branch feature/GEODE-7489
in repository https://gitbox.apache.org/repos/asf/geode.git

commit a6aeb5e6152fc012c81fe81f2b6f3e1ea9e8bf1e
Author: Bruce Schuchardt <bschuchardt@pivotal.io>
AuthorDate: Tue Nov 26 10:54:48 2019 -0800

    GEODE-7489 DistributionArchUnitTest is running out of memory for some users
    
    Added archive excludes to all membership arch unit tests.  Moved
    DistributionArchUnitTest to integrationTests and added an exclude
    for another integration test to it.
---
 geode-core/build.gradle                                        |  2 ++
 .../geode/distributed/internal/DistributionArchUnitTest.java   | 10 ++++++----
 .../internal/membership/MembershipDependenciesJUnitTest.java   |  6 +++++-
 .../internal/membership/gms/api/MembershipAPIArchUnitTest.java |  6 +++++-
 .../internal/tcpserver/TcpServerDependenciesTest.java          |  6 +++++-
 .../serialization/SerializationDependenciesJUnitTest.java      |  4 +++-
 6 files changed, 26 insertions(+), 8 deletions(-)

diff --git a/geode-core/build.gradle b/geode-core/build.gradle
index 9c01170..66cc0b9 100755
--- a/geode-core/build.gradle
+++ b/geode-core/build.gradle
@@ -361,6 +361,8 @@ dependencies {
   integrationTestCompile('org.powermock:powermock-api-mockito2')
   integrationTestCompile('org.springframework:spring-test')
   integrationTestCompile('pl.pragmatists:JUnitParams')
+  integrationTestCompile('com.tngtech.archunit:archunit-junit4')
+
 
   integrationTestRuntime('org.apache.derby:derby')
   integrationTestRuntime('xerces:xercesImpl')
diff --git a/geode-core/src/test/java/org/apache/geode/distributed/internal/DistributionArchUnitTest.java
b/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/DistributionArchUnitTest.java
similarity index 83%
rename from geode-core/src/test/java/org/apache/geode/distributed/internal/DistributionArchUnitTest.java
rename to geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/DistributionArchUnitTest.java
index 4cc17df..775399e 100644
--- a/geode-core/src/test/java/org/apache/geode/distributed/internal/DistributionArchUnitTest.java
+++ b/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/DistributionArchUnitTest.java
@@ -18,18 +18,20 @@ import static com.tngtech.archunit.core.domain.JavaClass.Predicates.resideInAPac
 import static com.tngtech.archunit.core.domain.JavaClass.Predicates.type;
 import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.classes;
 
+import com.tngtech.archunit.core.importer.ImportOption;
 import com.tngtech.archunit.junit.AnalyzeClasses;
 import com.tngtech.archunit.junit.ArchTest;
 import com.tngtech.archunit.junit.ArchUnitRunner;
+import com.tngtech.archunit.junit.CacheMode;
 import com.tngtech.archunit.lang.ArchRule;
-import org.junit.Ignore;
 import org.junit.runner.RunWith;
 
+import org.apache.geode.distributed.internal.membership.MembershipJUnitTest;
 import org.apache.geode.distributed.internal.membership.gms.api.Membership;
 
 @RunWith(ArchUnitRunner.class)
-@AnalyzeClasses(packages = "org.apache.geode")
-@Ignore("Disabling until we can fix the memory usage of this test")
+@AnalyzeClasses(packages = "org.apache.geode", cacheMode = CacheMode.PER_CLASS,
+    importOptions = ImportOption.DoNotIncludeArchives.class)
 public class DistributionArchUnitTest {
 
   @ArchTest
@@ -38,7 +40,7 @@ public class DistributionArchUnitTest {
       .should()
       .onlyBeAccessed()
       .byClassesThat(type(Distribution.class)
-          .or(type(DistributionTest.class))
+          .or(type(MembershipJUnitTest.class)) // another integrationTest
           .or(type(DistributionImpl.MyDCReceiver.class))
           .or(resideInAPackage("org.apache.geode.distributed.internal.membership.gms.."))
           .or(resideInAPackage("org.apache.geode.internal.tcp.."))
diff --git a/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/MembershipDependenciesJUnitTest.java
b/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/MembershipDependenciesJUnitTest.java
index 8746283..1453ab3 100644
--- a/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/MembershipDependenciesJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/MembershipDependenciesJUnitTest.java
@@ -20,10 +20,12 @@ import static com.tngtech.archunit.core.domain.JavaClass.Predicates.resideInAPac
 import static com.tngtech.archunit.core.domain.JavaClass.Predicates.type;
 import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.classes;
 
+import com.tngtech.archunit.core.importer.ImportOption;
 import com.tngtech.archunit.junit.AnalyzeClasses;
 import com.tngtech.archunit.junit.ArchIgnore;
 import com.tngtech.archunit.junit.ArchTest;
 import com.tngtech.archunit.junit.ArchUnitRunner;
+import com.tngtech.archunit.junit.CacheMode;
 import com.tngtech.archunit.lang.ArchRule;
 import org.junit.runner.RunWith;
 
@@ -51,7 +53,9 @@ import org.apache.geode.internal.security.SecurableCommunicationChannel;
 import org.apache.geode.internal.util.JavaWorkarounds;
 
 @RunWith(ArchUnitRunner.class)
-@AnalyzeClasses(packages = "org.apache.geode.distributed.internal.membership.gms..")
+@AnalyzeClasses(packages = "org.apache.geode.distributed.internal.membership.gms..",
+    cacheMode = CacheMode.PER_CLASS,
+    importOptions = ImportOption.DoNotIncludeArchives.class)
 public class MembershipDependenciesJUnitTest {
 
   /*
diff --git a/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/gms/api/MembershipAPIArchUnitTest.java
b/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/gms/api/MembershipAPIArchUnitTest.java
index df49fe4..0afc131 100644
--- a/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/gms/api/MembershipAPIArchUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/gms/api/MembershipAPIArchUnitTest.java
@@ -19,9 +19,11 @@ import static com.tngtech.archunit.core.domain.JavaClass.Predicates.resideInAPac
 import static com.tngtech.archunit.core.domain.JavaClass.Predicates.type;
 import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.classes;
 
+import com.tngtech.archunit.core.importer.ImportOption;
 import com.tngtech.archunit.junit.AnalyzeClasses;
 import com.tngtech.archunit.junit.ArchTest;
 import com.tngtech.archunit.junit.ArchUnitRunner;
+import com.tngtech.archunit.junit.CacheMode;
 import com.tngtech.archunit.lang.ArchRule;
 import org.junit.runner.RunWith;
 
@@ -36,7 +38,9 @@ import org.apache.geode.distributed.internal.membership.gms.Services;
 import org.apache.geode.distributed.internal.tcpserver.TcpClient;
 
 @RunWith(ArchUnitRunner.class)
-@AnalyzeClasses(packages = "org.apache.geode.distributed.internal.membership.gms.api")
+@AnalyzeClasses(packages = "org.apache.geode.distributed.internal.membership.gms.api",
+    cacheMode = CacheMode.PER_CLASS,
+    importOptions = ImportOption.DoNotIncludeArchives.class)
 public class MembershipAPIArchUnitTest {
 
   @ArchTest
diff --git a/geode-core/src/test/java/org/apache/geode/distributed/internal/tcpserver/TcpServerDependenciesTest.java
b/geode-core/src/test/java/org/apache/geode/distributed/internal/tcpserver/TcpServerDependenciesTest.java
index cd234c8..62e5d5a 100644
--- a/geode-core/src/test/java/org/apache/geode/distributed/internal/tcpserver/TcpServerDependenciesTest.java
+++ b/geode-core/src/test/java/org/apache/geode/distributed/internal/tcpserver/TcpServerDependenciesTest.java
@@ -19,9 +19,11 @@ import static com.tngtech.archunit.core.domain.JavaClass.Predicates.resideInAPac
 import static com.tngtech.archunit.core.domain.JavaClass.Predicates.type;
 import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.classes;
 
+import com.tngtech.archunit.core.importer.ImportOption;
 import com.tngtech.archunit.junit.AnalyzeClasses;
 import com.tngtech.archunit.junit.ArchTest;
 import com.tngtech.archunit.junit.ArchUnitRunner;
+import com.tngtech.archunit.junit.CacheMode;
 import com.tngtech.archunit.lang.ArchRule;
 import org.junit.runner.RunWith;
 
@@ -29,7 +31,9 @@ import org.apache.geode.DataSerializable;
 
 
 @RunWith(ArchUnitRunner.class)
-@AnalyzeClasses(packages = "org.apache.geode.distributed.internal.tcpserver")
+@AnalyzeClasses(packages = "org.apache.geode.distributed.internal.tcpserver",
+    cacheMode = CacheMode.PER_CLASS,
+    importOptions = ImportOption.DoNotIncludeArchives.class)
 public class TcpServerDependenciesTest {
 
   @ArchTest
diff --git a/geode-serialization/src/test/java/org/apache/geode/internal/serialization/SerializationDependenciesJUnitTest.java
b/geode-serialization/src/test/java/org/apache/geode/internal/serialization/SerializationDependenciesJUnitTest.java
index d680444..f10845b 100644
--- a/geode-serialization/src/test/java/org/apache/geode/internal/serialization/SerializationDependenciesJUnitTest.java
+++ b/geode-serialization/src/test/java/org/apache/geode/internal/serialization/SerializationDependenciesJUnitTest.java
@@ -22,13 +22,15 @@ import com.tngtech.archunit.core.importer.ImportOption;
 import com.tngtech.archunit.junit.AnalyzeClasses;
 import com.tngtech.archunit.junit.ArchTest;
 import com.tngtech.archunit.junit.ArchUnitRunner;
+import com.tngtech.archunit.junit.CacheMode;
 import com.tngtech.archunit.lang.ArchRule;
 import org.junit.runner.RunWith;
 
 
 @RunWith(ArchUnitRunner.class)
 @AnalyzeClasses(packages = "org.apache.geode.internal.serialization..",
-    importOptions = ImportOption.DoNotIncludeTests.class)
+    cacheMode = CacheMode.PER_CLASS,
+    importOptions = {ImportOption.DoNotIncludeArchives.class, ImportOption.DoNotIncludeTests.class})
 public class SerializationDependenciesJUnitTest {
 
   @ArchTest


Mime
View raw message