Author: bdelacretaz
Date: Tue Dec 10 16:51:08 2013
New Revision: 1549887

URL: http://svn.apache.org/r1549887
Log:
SLING-3259 - increase Framework.waitForStop timeout

Modified:
    
sling/trunk/launchpad/base/src/test/java/org/apache/sling/launchpad/base/impl/SlingFelixTest.java

Modified: 
sling/trunk/launchpad/base/src/test/java/org/apache/sling/launchpad/base/impl/SlingFelixTest.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/launchpad/base/src/test/java/org/apache/sling/launchpad/base/impl/SlingFelixTest.java?rev=1549887&r1=1549886&r2=1549887&view=diff
==============================================================================
--- 
sling/trunk/launchpad/base/src/test/java/org/apache/sling/launchpad/base/impl/SlingFelixTest.java
 (original)
+++ 
sling/trunk/launchpad/base/src/test/java/org/apache/sling/launchpad/base/impl/SlingFelixTest.java
 Tue Dec 10 16:51:08 2013
@@ -45,7 +45,9 @@ import org.osgi.service.packageadmin.Pac
 
 public class SlingFelixTest {
 
-    public static final int N_START_STOP = 10;
+    public static final int N_START_STOP = 100;
+    public static final long WAIT_FOR_STOP_TIMEOUT_MSEC = 1000;
+    public static final long STOPPED_CALLED_TIMEOUT_MSEC = 5000L;
     private final TestNotifiable notifiable = new TestNotifiable();
 
     private SlingFelix framework;
@@ -87,8 +89,8 @@ public class SlingFelixTest {
         // as the notifiable is notified async we wait
         final long start = System.currentTimeMillis();
         while ( !this.notifiable.stoppedCalled ) {
-            // we wait max 3 seconds
-            if ( System.currentTimeMillis() - start > 3000 ) {
+            // timeout on this wait
+            if ( System.currentTimeMillis() - start > 
STOPPED_CALLED_TIMEOUT_MSEC ) {
                 break;
             }
             try {
@@ -185,8 +187,8 @@ public class SlingFelixTest {
         }
         try {
             f.stop();
-            if (f.waitForStop(10L).getType() == FrameworkEvent.WAIT_TIMEDOUT) {
-                fail("Timed out waiting for framework to stop");
+            if (f.waitForStop(WAIT_FOR_STOP_TIMEOUT_MSEC).getType() == 
FrameworkEvent.WAIT_TIMEDOUT) {
+                fail("Timed out waiting for framework to stop, after " + 
WAIT_FOR_STOP_TIMEOUT_MSEC + " msec");
             }
         } catch (Exception e) {
             fail("Cannot stop OSGi Framework: " + e);


Reply via email to