From: Simon Brandhof Date: Tue, 11 Apr 2017 08:23:31 +0000 (+0200) Subject: Do not use Java plugin with dynamic version in server startup perf test X-Git-Tag: 6.4-RC1~459 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=b849dae56cdf6d448136fdedd31510786f88db56;p=sonarqube.git Do not use Java plugin with dynamic version in server startup perf test The Java plugin was defined with version LATEST_RELEASE, so version may change over time and break the performance test. It is replaced by Xoo plugin. --- diff --git a/tests/perf/src/test/java/org/sonarsource/sonarqube/perf/server/ServerTest.java b/tests/perf/src/test/java/org/sonarsource/sonarqube/perf/server/ServerTest.java index a4655e3ed1a..af7a33646ae 100644 --- a/tests/perf/src/test/java/org/sonarsource/sonarqube/perf/server/ServerTest.java +++ b/tests/perf/src/test/java/org/sonarsource/sonarqube/perf/server/ServerTest.java @@ -20,6 +20,8 @@ package org.sonarsource.sonarqube.perf.server; import com.sonar.orchestrator.Orchestrator; +import com.sonar.orchestrator.locator.FileLocation; +import java.io.File; import java.io.IOException; import java.util.Collections; import java.util.Date; @@ -43,8 +45,7 @@ public class ServerTest extends PerfTestCase { public void server_startup_and_shutdown() throws Exception { String defaultWebJavaOptions = "-Xmx768m -XX:+HeapDumpOnOutOfMemoryError -Djava.awt.headless=true -Dfile.encoding=UTF-8"; Orchestrator orchestrator = Orchestrator.builderEnv() - .setOrchestratorProperty("javaVersion", "LATEST_RELEASE") - .addPlugin("java") + .addPlugin(FileLocation.byWildcardMavenFilename(new File("../../plugins/sonar-xoo-plugin/target"), "sonar-xoo-plugin-*.jar")) // See http://wiki.apache.org/tomcat/HowTo/FasterStartUp // Sometimes source of entropy is too small and Tomcat spends ~20 seconds on the step : @@ -59,7 +60,7 @@ public class ServerTest extends PerfTestCase { // compare dates of first and last log long firstLogDate = ServerLogs.extractFirstDate(readLines(orchestrator.getServer().getAppLogs())).getTime(); long startedAtDate = extractStartedAtDate(orchestrator); - assertDurationAround(startedAtDate - firstLogDate, 28_000); + assertDurationAround(startedAtDate - firstLogDate, 23_000); ServerLogs.clear(orchestrator); orchestrator.stop(); @@ -83,6 +84,7 @@ public class ServerTest extends PerfTestCase { startedAtDate = extractStartedDate(readLines(orchestrator.getServer().getCeLogs())); } catch (InterruptedException e) { // ignored + Thread.currentThread().interrupt(); } } return startedAtDate.getTime();