0 Replies Latest reply on Sep 4, 2015 11:59 AM by chakravarthyvp

    Starting containers concurrently in manual mode - does not work

    chakravarthyvp

      Hi Guys,

       

           We are using jboss-as-arquillian-container-managed, version 7.2.0-Final. We use arquillian for integration tests. There are around 50 test suites where each of them start multiple containers and test availability, clustering capabilities of our application ears, caching etc.,

           The total suite runs about an hour and we are trying to optimize this to improve on the overall running time of the suites.

       

           In relation to test, we intend to start the containers parallely using the ContainerController and it fails with

       

      =====================================================================================

              start_containers(com.integration.eventbus.jms.cluster.ManagedJmsCDIConsumerClusterTest)  Time elapsed: 0.662 sec  <<< ERROR!

              java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: No deployment scenario in context

                      at org.jboss.arquillian.container.test.impl.client.container.ClientContainerController.start(ClientContainerController.java:68)

                     at com.integration.ServerController.call(ServerController.java:52)t(ContainerEventController.java:142)

      =====================================================================================


            {code}

       

          @ArquillianResource

          public ContainerController controller;

       

          @ArquillianResource

          private Deployer deployer;

       

          @Test

          @InSequence(1)

          public void start_containers() throws ExecutionException, InterruptedException {

       

              final ServerController server1 = new ServerController(controller, SERVER_1, deployer, new String[]{DEPLOYMENT_1, TEST_DEPLOYMENT_1});

              final ServerController server2 = new ServerController(controller, SERVER_1, deployer, new String[]{DEPLOYMENT_2, TEST_DEPLOYMENT_2});

              final Set<Future<Boolean>> serverSet = new HashSet<Future<Boolean>>();

           

              serverSet.add(pool.submit(server1));

              serverSet.add(pool.submit(server2));

         }//end of test

       

          {code}

       

          ServerController.java - this is a callable class.

       

            {code}

         @Override

          public Boolean call() throws Exception {

              try {

                  this.controller.start(serverName);

                  deployAll();

              } catch (final Throwable t) {

                  t.printStackTrace();

                  throw t;

              }

              return controller.isStarted(serverName);

          }

            {code}

       

          If the containers are started sequentially it starts fine. Looks like ContainerController is not thread safe and it does not switch context for multiple starts the same time.

       

          Any help is highly appreciated !

       

      Best Regards

      Varaga

       

          P.S: We look at remote containers as one of our options. It is harder for us to go with this option as our test suites run on different platforms[OS] and we got to control the lifecyle of the containers at varied times, between tests and within the tests too.