Skip to content

Commit

Permalink
GEODE-7489 DistributionArchUnitTest is running out of memory for some…
Browse files Browse the repository at this point in the history
… users (apache#4377)

Added archive excludes to all membership arch unit tests.  Moved
DistributionArchUnitTest to integrationTests and added an exclude
for another integration test to it.
  • Loading branch information
bschuchardt authored Nov 27, 2019
1 parent 518f926 commit 6bc6e59
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 8 deletions.
2 changes: 2 additions & 0 deletions geode-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,20 @@
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
Expand All @@ -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.."))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@
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;

Expand Down Expand Up @@ -51,7 +53,9 @@
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 {

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@
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;

Expand All @@ -36,7 +38,9 @@
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,20 @@
import static com.tngtech.archunit.core.domain.JavaClass.Predicates.resideInAPackage;
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;



@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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@
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
Expand Down

0 comments on commit 6bc6e59

Please sign in to comment.