From d05ecfb545be91f64ed5c3ab25752b63d9dafdcd Mon Sep 17 00:00:00 2001 From: David Latorre Date: Fri, 3 Jan 2020 13:29:04 +0000 Subject: [PATCH] speed up kotlin integration tests by reusing the JVM fork. (#579) * speed up the kotlin functional tests by reusing the same JVM instead of forking a new one for each test class. --- pom.xml | 6 ++++-- system-tests/e2e-suite/pom.xml | 1 + system-tests/ft-suite/pom.xml | 7 ------- .../com/hotels/styx/resiliency/OriginResourcesSpec.kt | 4 ++-- .../kotlin/com/hotels/styx/routing/PluginsPipelineSpec.kt | 5 +++++ 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/pom.xml b/pom.xml index 6108966345..3203f69cb2 100644 --- a/pom.xml +++ b/pom.xml @@ -729,7 +729,8 @@ maven-failsafe-plugin ${maven-failsafe-plugin.version} - always + 1 + true -Xmx300m -XX:+HeapDumpOnOutOfMemoryError @@ -1093,7 +1094,8 @@ maven-failsafe-plugin - always + 1 + true -Xmx300m -XX:+HeapDumpOnOutOfMemoryError diff --git a/system-tests/e2e-suite/pom.xml b/system-tests/e2e-suite/pom.xml index faf0117e35..9d05b7b9e6 100644 --- a/system-tests/e2e-suite/pom.xml +++ b/system-tests/e2e-suite/pom.xml @@ -194,6 +194,7 @@ ${project.build.directory}/surefire-reports . WDF TestSuite.txt + T> ADVANCED diff --git a/system-tests/ft-suite/pom.xml b/system-tests/ft-suite/pom.xml index 3eaa56e6dc..2f7e048337 100644 --- a/system-tests/ft-suite/pom.xml +++ b/system-tests/ft-suite/pom.xml @@ -86,13 +86,6 @@ maven-failsafe-plugin ${maven-failsafe-plugin.version} - - - org.junit.platform - junit-platform-surefire-provider - ${junit.platform.surefire.provider.version} - - diff --git a/system-tests/ft-suite/src/test/kotlin/com/hotels/styx/resiliency/OriginResourcesSpec.kt b/system-tests/ft-suite/src/test/kotlin/com/hotels/styx/resiliency/OriginResourcesSpec.kt index b725103462..9b85b49af9 100644 --- a/system-tests/ft-suite/src/test/kotlin/com/hotels/styx/resiliency/OriginResourcesSpec.kt +++ b/system-tests/ft-suite/src/test/kotlin/com/hotels/styx/resiliency/OriginResourcesSpec.kt @@ -50,7 +50,7 @@ class OriginResourcesSpec : StringSpec() { .withStatus(200) .withBody("mock-server-01")) - + val initialThreadcount = threadCount("Styx-Client-Worker") init { "Client thread pool configuration" { val clientThreadCount = run { @@ -67,7 +67,7 @@ class OriginResourcesSpec : StringSpec() { } // From the static configuration below - clientThreadCount shouldBe 3 + clientThreadCount-initialThreadcount shouldBe 3 } "Uses the same thread pool for reloaded origins" { diff --git a/system-tests/ft-suite/src/test/kotlin/com/hotels/styx/routing/PluginsPipelineSpec.kt b/system-tests/ft-suite/src/test/kotlin/com/hotels/styx/routing/PluginsPipelineSpec.kt index 0c0daf0a77..861477be4e 100644 --- a/system-tests/ft-suite/src/test/kotlin/com/hotels/styx/routing/PluginsPipelineSpec.kt +++ b/system-tests/ft-suite/src/test/kotlin/com/hotels/styx/routing/PluginsPipelineSpec.kt @@ -21,6 +21,7 @@ import com.hotels.styx.client.StyxHttpClient import com.hotels.styx.support.StyxServerProvider import com.hotels.styx.support.proxyHttpHostHeader import com.hotels.styx.support.wait +import io.kotlintest.Spec import io.kotlintest.matchers.collections.shouldContainInOrder import io.kotlintest.specs.FeatureSpec import org.slf4j.LoggerFactory @@ -134,4 +135,8 @@ class PluginsPipelineSpec : FeatureSpec() { return Paths.get(getSystemClassLoader().getResource("")!!.getFile()); } + override fun afterSpec(spec: Spec) { + styxServer.stop() + super.afterSpec(spec) + } }