Skip to content

Commit

Permalink
speed up kotlin integration tests by reusing the JVM fork. (#579)
Browse files Browse the repository at this point in the history
* speed up the kotlin functional tests by reusing the same JVM instead of forking a new one for each test class.
  • Loading branch information
dvlato authored Jan 3, 2020
1 parent 3a3fbb2 commit d05ecfb
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 11 deletions.
6 changes: 4 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,8 @@
<artifactId>maven-failsafe-plugin</artifactId>
<version>${maven-failsafe-plugin.version}</version>
<configuration>
<forkMode>always</forkMode>
<forkCount>1</forkCount>
<reuseForks>true</reuseForks>
<argLine>
-Xmx300m
-XX:+HeapDumpOnOutOfMemoryError
Expand Down Expand Up @@ -1093,7 +1094,8 @@
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<forkMode>always</forkMode>
<forkCount>1</forkCount>
<reuseForks>true</reuseForks>
<argLine>
-Xmx300m
-XX:+HeapDumpOnOutOfMemoryError
Expand Down
1 change: 1 addition & 0 deletions system-tests/e2e-suite/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@
<reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
<junitxml>.</junitxml>
<filereports>WDF TestSuite.txt</filereports>
<stdout>T</stdout>>
<systemProperties>
<io.netty.leakDetectionLevel>ADVANCED</io.netty.leakDetectionLevel>
</systemProperties>
Expand Down
7 changes: 0 additions & 7 deletions system-tests/ft-suite/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,6 @@
<artifactId>maven-failsafe-plugin</artifactId>
<version>${maven-failsafe-plugin.version}</version>

<dependencies>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-surefire-provider</artifactId>
<version>${junit.platform.surefire.provider.version}</version>
</dependency>
</dependencies>

<executions>
<execution>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -134,4 +135,8 @@ class PluginsPipelineSpec : FeatureSpec() {
return Paths.get(getSystemClassLoader().getResource("")!!.getFile());
}

override fun afterSpec(spec: Spec) {
styxServer.stop()
super.afterSpec(spec)
}
}

0 comments on commit d05ecfb

Please sign in to comment.