maven-surefire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From krosenv...@apache.org
Subject svn commit: r1041091 - /maven/surefire/trunk/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/ConfigurableParallelComputerTest.java
Date Wed, 01 Dec 2010 17:18:11 GMT
Author: krosenvold
Date: Wed Dec  1 17:18:11 2010
New Revision: 1041091

URL: http://svn.apache.org/viewvc?rev=1041091&view=rev
Log:
o Added a sleepEvenOnWindowsMethod to see if that helps

Modified:
    maven/surefire/trunk/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/ConfigurableParallelComputerTest.java

Modified: maven/surefire/trunk/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/ConfigurableParallelComputerTest.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/ConfigurableParallelComputerTest.java?rev=1041091&r1=1041090&r2=1041091&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/ConfigurableParallelComputerTest.java
(original)
+++ maven/surefire/trunk/surefire-providers/surefire-junit47/src/test/java/org/apache/maven/surefire/junitcore/ConfigurableParallelComputerTest.java
Wed Dec  1 17:18:11 2010
@@ -240,6 +240,17 @@ public class ConfigurableParallelCompute
         return realClasses.toArray( new Class[realClasses.size()] );
     }
 
+    static void sleepReallyEvenOnWindows(long ms)
+        throws InterruptedException
+    {
+        long endAt = System.currentTimeMillis() + ms;
+        Thread.sleep( ms);
+        while ( endAt > System.currentTimeMillis()){
+            Thread.sleep( ms/10);
+            Thread.yield();
+        }
+
+    }
     public static class Dummy
     {
         @Test
@@ -283,21 +294,21 @@ public class ConfigurableParallelCompute
         public void testNotMuch()
             throws InterruptedException
         {
-            Thread.sleep( scaling );
+            sleepReallyEvenOnWindows( scaling );
         }
 
         @Test
         public void testNotMuch2()
             throws InterruptedException
         {
-            Thread.sleep( 3 * scaling );
+            sleepReallyEvenOnWindows( 3 * scaling );
         }
 
         @Test
         public void testNotMuch3()
             throws InterruptedException
         {
-            Thread.sleep( 2 * scaling );
+            sleepReallyEvenOnWindows( 2 * scaling );
         }
 
 



Mime
View raw message