You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ti...@apache.org on 2018/04/02 19:06:23 UTC
[maven-surefire] 01/01: windows virtualization problem in Jenkins CI
This is an automated email from the ASF dual-hosted git repository.
tibordigana pushed a commit to branch windows
in repository https://gitbox.apache.org/repos/asf/maven-surefire.git
commit 15ba36339f9f60a7f4f7de6f7288f944af4a25fe
Author: Tibor17 <ti...@apache.org>
AuthorDate: Mon Apr 2 21:05:59 2018 +0200
windows virtualization problem in Jenkins CI
---
Jenkinsfile | 4 ++--
surefire-its/pom.xml | 3 ++-
surefire-its/src/test/resources/fail-fast-junit/pom.xml | 1 +
.../src/test/resources/fail-fast-junit/src/test/java/pkg/ATest.java | 5 +++--
.../src/test/resources/fail-fast-junit/src/test/java/pkg/BTest.java | 5 +++--
.../src/test/resources/fail-fast-junit/src/test/java/pkg/CTest.java | 5 +++--
.../src/test/resources/fail-fast-junit/src/test/java/pkg/DTest.java | 5 +++--
.../src/test/resources/fork-mode/src/test/java/forkMode/Test1.java | 6 +++---
.../src/test/resources/fork-mode/src/test/java/forkMode/Test2.java | 4 +++-
.../src/test/resources/fork-mode/src/test/java/forkMode/Test3.java | 4 +++-
10 files changed, 26 insertions(+), 16 deletions(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index e8e2179..5b5f9bb 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -31,8 +31,8 @@ properties(
)
final def oses = ['linux', 'windows']
-final def mavens = env.BRANCH_NAME == 'master' ? ['3.2.x', '3.3.x', '3.5.x'] : ['3.5.x']
-final def jdks = env.BRANCH_NAME == 'master' ? [7, 8, 9, 10] : [7, 10]
+final def mavens = ['3.2.x', '3.3.x', '3.5.x']
+final def jdks = [7, 8, 9, 10]
final def options = ['-e', '-V', '-B', '-nsu', '-P', 'run-its']
final def goals = ['clean', 'install', 'jacoco:report']
diff --git a/surefire-its/pom.xml b/surefire-its/pom.xml
index 88a4870..8ebdfc2 100644
--- a/surefire-its/pom.xml
+++ b/surefire-its/pom.xml
@@ -104,7 +104,8 @@
<forkMode>once</forkMode>
<argLine>-server -Xmx64m -XX:+UseG1GC -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -Djava.awt.headless=true</argLine>
<includes>
- <include>org/apache/**/*IT*.java</include>
+ <include>org/apache/**/ForkModeIT.java</include>
+ <include>org/apache/**/FailFastJUnitIT.java</include>
</includes>
<!-- Pass current surefire version to the main suite so that it -->
<!-- can forward to all integration test projects. SUREFIRE-513 -->
diff --git a/surefire-its/src/test/resources/fail-fast-junit/pom.xml b/surefire-its/src/test/resources/fail-fast-junit/pom.xml
index b82448e..f46d4ea 100644
--- a/surefire-its/src/test/resources/fail-fast-junit/pom.xml
+++ b/surefire-its/src/test/resources/fail-fast-junit/pom.xml
@@ -54,6 +54,7 @@
<configuration>
<runOrder>alphabetical</runOrder>
<forkMode>once</forkMode><!--override to default value in order to enable forkCount-->
+ <argLine>-Xms16m -Xmx32m</argLine>
</configuration>
</plugin>
</plugins>
diff --git a/surefire-its/src/test/resources/fail-fast-junit/src/test/java/pkg/ATest.java b/surefire-its/src/test/resources/fail-fast-junit/src/test/java/pkg/ATest.java
index 4d09bab..0104224 100644
--- a/surefire-its/src/test/resources/fail-fast-junit/src/test/java/pkg/ATest.java
+++ b/surefire-its/src/test/resources/fail-fast-junit/src/test/java/pkg/ATest.java
@@ -2,17 +2,18 @@ package pkg;
import org.junit.Test;
-import java.util.concurrent.TimeUnit;
+import static java.util.concurrent.TimeUnit.MILLISECONDS;
public class ATest
{
+ static final int DELAY_MULTIPLIER = 3;
@Test
public void someMethod()
throws Exception
{
// checking processros # due to very slow Windows Jenkins machines
- TimeUnit.MILLISECONDS.sleep( Runtime.getRuntime().availableProcessors() == 1 ? 3600 : 1500 );
+ MILLISECONDS.sleep( DELAY_MULTIPLIER * ( Runtime.getRuntime().availableProcessors() == 1 ? 3600L : 1500L ) );
throw new RuntimeException( "assert \"foo\" == \"bar\"\n" +
" |\n"
+ " false" );
diff --git a/surefire-its/src/test/resources/fail-fast-junit/src/test/java/pkg/BTest.java b/surefire-its/src/test/resources/fail-fast-junit/src/test/java/pkg/BTest.java
index 1dc76b7..dfea0dd 100644
--- a/surefire-its/src/test/resources/fail-fast-junit/src/test/java/pkg/BTest.java
+++ b/surefire-its/src/test/resources/fail-fast-junit/src/test/java/pkg/BTest.java
@@ -2,7 +2,8 @@ package pkg;
import org.junit.Test;
-import java.util.concurrent.TimeUnit;
+import static java.util.concurrent.TimeUnit.MILLISECONDS;
+import static pkg.ATest.DELAY_MULTIPLIER;
public class BTest
{
@@ -11,7 +12,7 @@ public class BTest
throws InterruptedException
{
// checking processros # due to very slow Windows Jenkins machines
- TimeUnit.MILLISECONDS.sleep( Runtime.getRuntime().availableProcessors() == 1 ? 9000 : 3750 );
+ MILLISECONDS.sleep( DELAY_MULTIPLIER * ( Runtime.getRuntime().availableProcessors() == 1 ? 9000L : 3750L ) );
throw new RuntimeException();
}
diff --git a/surefire-its/src/test/resources/fail-fast-junit/src/test/java/pkg/CTest.java b/surefire-its/src/test/resources/fail-fast-junit/src/test/java/pkg/CTest.java
index 2660779..125d5d4 100644
--- a/surefire-its/src/test/resources/fail-fast-junit/src/test/java/pkg/CTest.java
+++ b/surefire-its/src/test/resources/fail-fast-junit/src/test/java/pkg/CTest.java
@@ -2,7 +2,8 @@ package pkg;
import org.junit.Test;
-import java.util.concurrent.TimeUnit;
+import static java.util.concurrent.TimeUnit.MILLISECONDS;
+import static pkg.ATest.DELAY_MULTIPLIER;
public class CTest
{
@@ -11,7 +12,7 @@ public class CTest
throws InterruptedException
{
// checking processros # due to very slow Windows Jenkins machines
- TimeUnit.MILLISECONDS.sleep( Runtime.getRuntime().availableProcessors() == 1 ? 9000 : 3750 );
+ MILLISECONDS.sleep( DELAY_MULTIPLIER * ( Runtime.getRuntime().availableProcessors() == 1 ? 9000L : 3750L ) );
}
}
diff --git a/surefire-its/src/test/resources/fail-fast-junit/src/test/java/pkg/DTest.java b/surefire-its/src/test/resources/fail-fast-junit/src/test/java/pkg/DTest.java
index 12a9bc7..3d69f71 100644
--- a/surefire-its/src/test/resources/fail-fast-junit/src/test/java/pkg/DTest.java
+++ b/surefire-its/src/test/resources/fail-fast-junit/src/test/java/pkg/DTest.java
@@ -2,7 +2,8 @@ package pkg;
import org.junit.Test;
-import java.util.concurrent.TimeUnit;
+import static java.util.concurrent.TimeUnit.MILLISECONDS;
+import static pkg.ATest.DELAY_MULTIPLIER;
public class DTest
{
@@ -11,7 +12,7 @@ public class DTest
throws InterruptedException
{
// checking processros # due to very slow Windows Jenkins machines
- TimeUnit.MILLISECONDS.sleep( Runtime.getRuntime().availableProcessors() == 1 ? 9000 : 3750 );
+ MILLISECONDS.sleep( DELAY_MULTIPLIER * ( Runtime.getRuntime().availableProcessors() == 1 ? 9000L : 3750L ) );
}
}
diff --git a/surefire-its/src/test/resources/fork-mode/src/test/java/forkMode/Test1.java b/surefire-its/src/test/resources/fork-mode/src/test/java/forkMode/Test1.java
index 7b3f5ed..5588106 100644
--- a/surefire-its/src/test/resources/fork-mode/src/test/java/forkMode/Test1.java
+++ b/surefire-its/src/test/resources/fork-mode/src/test/java/forkMode/Test1.java
@@ -34,10 +34,10 @@ public class Test1
private static final Random RANDOM = new Random();
public void test1()
- throws IOException, InterruptedException
+ throws Exception
{
- int sleepLength = Integer.valueOf( System.getProperty( "sleepLength", "750" ));
- Thread.sleep(sleepLength);
+ int sleepLength = Integer.valueOf( System.getProperty( "sleepLength", "750" ) );
+ Thread.sleep( sleepLength );
dumpPidFile( this );
}
diff --git a/surefire-its/src/test/resources/fork-mode/src/test/java/forkMode/Test2.java b/surefire-its/src/test/resources/fork-mode/src/test/java/forkMode/Test2.java
index 33d3cf1..2d4b1dc 100644
--- a/surefire-its/src/test/resources/fork-mode/src/test/java/forkMode/Test2.java
+++ b/surefire-its/src/test/resources/fork-mode/src/test/java/forkMode/Test2.java
@@ -27,7 +27,9 @@ public class Test2
extends TestCase
{
- public void test2() throws IOException {
+ public void test2() throws Exception {
+ int sleepLength = Integer.valueOf( System.getProperty( "sleepLength", "750" ) );
+ Thread.sleep( sleepLength );
Test1.dumpPidFile(this);
}
diff --git a/surefire-its/src/test/resources/fork-mode/src/test/java/forkMode/Test3.java b/surefire-its/src/test/resources/fork-mode/src/test/java/forkMode/Test3.java
index c8eef74..a0f4f2c 100644
--- a/surefire-its/src/test/resources/fork-mode/src/test/java/forkMode/Test3.java
+++ b/surefire-its/src/test/resources/fork-mode/src/test/java/forkMode/Test3.java
@@ -27,7 +27,9 @@ public class Test3
extends TestCase
{
- public void test3() throws IOException {
+ public void test3() throws Exception {
+ int sleepLength = Integer.valueOf( System.getProperty( "sleepLength", "750" ) );
+ Thread.sleep( sleepLength );
Test1.dumpPidFile(this);
}
--
To stop receiving notification emails like this one, please contact
tibordigana@apache.org.