Buggy code:
public class OperationCancellationUnitTestCase { protected static boolean useNonRecursive ; private static final Executor executor = Executors . newCachedThreadPool ( ) ; private static CountDownLatch blockObject ; private static CountDownLatch latch ; private ServiceContainer container ; private ModelController controller ; private ModelControllerClient client ; public static void toggleRuntimeState ( AtomicBoolean state ) { } @ Before public void setupController ( ) throws InterruptedException { } @ After public void shutdownServiceContainer ( ) { } private static void releaseBlockingThreads ( ) { } private static void block ( ) { } public static class ModelControllerService extends AbstractControllerService { final AtomicBoolean state = new AtomicBoolean ( true ) ; final CountDownLatch latch = new CountDownLatch ( 1 ) ; ModelControllerService ( final ControlledProcessState processState ) { } ModelControllerService ( final ControlledProcessState processState , final ConfigurationPersister configurationPersister ) { } @ Override protected void initModel ( Resource rootResource , ManagementResourceRegistration rootRegistration ) { } @ Override protected void finishBoot ( ) throws ConfigurationPersistenceException { } } @ Test public void testModelStageInterruption ( ) throws Exception { } @ Test public void testModelStageInterruptionNonRecursive ( ) throws Exception { } @ Test public void testRuntimeStageInterruption ( ) throws Exception { } @ Test public void testRuntimeStageInterruptionNonRecursive ( ) throws Exception { } @ Test public void testVerifyStageInterruption ( ) throws Exception { } @ Test public void testVerifyStageInterruptionNonRecursive ( ) throws Exception { } @ Test public void testReadResourceForUpdateInterruption ( ) throws Exception { } @ Test public void testReadResourceForUpdateInterruptionNonRecursive ( ) throws Exception { } public static ModelNode getOperation ( String opName , String attr , int val ) { } public static ModelNode getOperation ( String opName , String attr , int val , String rollbackName ) { } public static ModelNode getOperation ( String opName , String attr , int val , String rollbackName , boolean async ) { } public static class SetupHandler implements OperationStepHandler { @ Override public void execute ( OperationContext context , ModelNode operation ) { ModelNode model = new ModelNode ( ) ; model . get ( "attr1" ) . set ( 1 ) ; model . get ( "attr2" ) . set ( 2 ) ; context . readResourceForUpdate ( EMPTY_ADDRESS ) . getModel ( ) . set ( model ) ; final ModelNode child1 = new ModelNode ( ) ; child1 . get ( "attribute1" ) . set ( 1 ) ; final ModelNode child2 = new ModelNode ( ) ; child2 . get ( "attribute2" ) . set ( 2 ) ; context . createResource ( EMPTY_ADDRESS . append ( PathElement . pathElement ( "child" , "one" ) ) ) . getModel ( ) . set ( child1 ) ; context . createResource ( EMPTY_ADDRESS . append ( PathElement . pathElement ( "child" , "two" ) ) ) . getModel ( ) . set ( child2 ) ; <START_BUG> context . completeStep ( ) ; <END_BUG> } } public static class ModelStageGoodHandler implements OperationStepHandler { static CountDownLatch goodHandlerLatch ; ModelStageGoodHandler ( ) { } @ Override public void execute ( OperationContext context , ModelNode operation ) { String name = operation . require ( NAME ) . asString ( ) ; OperationCancellationUnitTestCase . ModelStageGoodHandler . goodHandlerLatch . countDown ( ) ; ModelNode model = context . readResourceForUpdate ( EMPTY_ADDRESS ) . getModel ( ) ; ModelNode attr = model . get ( name ) ; final int current = attr . asInt ( ) ; attr . set ( operation . require ( VALUE ) ) ; context . getResult ( ) . set ( current ) ; if ( OperationCancellationUnitTestCase . useNonRecursive ) { context . completeStep ( NOOP_ROLLBACK_HANDLER ) ; } else { context . completeStep ( ) ; } } } public static class ModelStageBlocksHandler implements OperationStepHandler { @ Override public void execute ( OperationContext context , ModelNode operation ) { context . readResourceForUpdate ( EMPTY_ADDRESS ) . getModel ( ) ; OperationCancellationUnitTestCase . block ( ) ; context . getResult ( ) ; if ( OperationCancellationUnitTestCase . useNonRecursive ) { context . completeStep ( NOOP_ROLLBACK_HANDLER ) ; } else { context . completeStep ( ) ; } } } public static class RuntimeStageBlocksHandler implements OperationStepHandler { private final AtomicBoolean state ; public RuntimeStageBlocksHandler ( AtomicBoolean state ) { } @ Override public void execute ( OperationContext context , ModelNode operation ) { String name = operation . require ( "name" ) . asString ( ) ; context . readResourceForUpdate ( EMPTY_ADDRESS ) . getModel ( ) . get ( name ) ; context . getResult ( ) ; context . addStep ( new OperationStepHandler ( ) { @ Override public void execute ( OperationContext context , ModelNode operation ) { OperationCancellationUnitTestCase . toggleRuntimeState ( state ) ; OperationCancellationUnitTestCase . block ( ) ; if ( OperationCancellationUnitTestCase . useNonRecursive ) { context . completeStep ( new OperationContext . RollbackHandler ( ) { @ Override public void handleRollback ( OperationContext context , ModelNode operation ) { OperationCancellationUnitTestCase . toggleRuntimeState ( state ) ; } } ) ; } else if ( ( context . completeStep ( ) ) == ( ResultAction . ROLLBACK ) ) { OperationCancellationUnitTestCase . toggleRuntimeState ( state ) ; } } } , RUNTIME ) ; if ( OperationCancellationUnitTestCase . useNonRecursive ) { context . completeStep ( NOOP_ROLLBACK_HANDLER ) ; } else { context . completeStep ( ) ; } } } public static class GoodServiceHandler implements OperationStepHandler { @ Override public void execute ( OperationContext context , ModelNode operation ) { context . readResourceForUpdate ( EMPTY_ADDRESS ) ; context . addStep ( new OperationStepHandler ( ) { @ Override public void execute ( final OperationContext context , ModelNode operation ) { final ServiceName svcName = JBOSS . append ( "good-service" ) ; ServiceVerificationHandler verificationHandler = new ServiceVerificationHandler ( ) ; context . getServiceTarget ( ) . addService ( svcName , NULL ) . addListener ( verificationHandler ) . install ( ) ; context . addStep ( verificationHandler , VERIFY ) ;

Fix:
context . stepCompleted ( ) ;