Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[MSC-106] Solve random hanging problem involving NewDependentOfFailin…
…gServiceTestCase and enable the test.
  • Loading branch information
fl4via committed Jul 7, 2011
1 parent e7727ce commit f28a118
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
Expand Up @@ -35,7 +35,6 @@
import org.jboss.msc.service.StartException;
import org.jboss.msc.service.StopContext;
import org.jboss.msc.util.TestServiceListener;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;

Expand All @@ -51,7 +50,6 @@
*/
@RunWith(BMUnitRunner.class)
@BMScript(dir="src/test/resources")
@Ignore // FIXME this test hangs sometimes... this is currently under investigation
public class NewDependentOfFailingServiceTestCase extends AbstractRaceConditionTest {

private static final TestServiceListener testListener = new TestServiceListener();
Expand Down
Expand Up @@ -26,17 +26,18 @@ METHOD failed
AT EXIT
IF TRUE
DO
signalWake("failCountPlusPlus", true);
signalWake("failCountPlusPlus1", true);
signalWake("failCountPlusPlus2", true);
ENDRULE

RULE transition at StartTask.startFailed
CLASS org.jboss.msc.service.ServiceControllerImpl$StartTask
METHOD startFailed
HELPER org.jboss.msc.racecondition.NullHelper
AT EXIT
IF TRUE
DO
signalWake("failCountPlusPlus", true);
signalWake("failCountPlusPlus1", true);
signalWake("failCountPlusPlus2", true);
ENDRULE

# hold listenerTask just to make sure asyncTasks is > 0 and transition won't
Expand All @@ -49,7 +50,7 @@ AT ENTRY
IF !isNull($3) && $3.toString().endsWith("START_INITIATING to STARTING")
DO
debug("listenerTask waiting for failCont++"),
waitFor("failCountPlusPlus", 1000000),
waitFor("failCountPlusPlus1", 1000000),
# hold transition from occurring until new dependent has been added
debug("wait for ServiceControllerImpl.newDependent"),
waitFor("newDependent completed", 100000),
Expand All @@ -64,7 +65,7 @@ IF TRUE
DO
# wait for failure to occur
debug("waiting for failure on dependency"),
waitFor("failCountPlusPlus", 1000000),
waitFor("failCountPlusPlus2", 1000000),
debug("proceeding with ServiceRegistrationImpl.addDependent");
ENDRULE

Expand Down

0 comments on commit f28a118

Please sign in to comment.