]> source.dussan.org Git - sonarqube.git/commitdiff
Do not use Java plugin with dynamic version in server startup perf test
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Tue, 11 Apr 2017 08:23:31 +0000 (10:23 +0200)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Tue, 11 Apr 2017 12:57:46 +0000 (14:57 +0200)
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.

tests/perf/src/test/java/org/sonarsource/sonarqube/perf/server/ServerTest.java

index a4655e3ed1a3feedf7a5918b4bcd1878d6128959..af7a33646ae21abdacfca688ab03490f81c7961b 100644 (file)
@@ -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();