I am using very similar method, using the executeCommand,  almost identical to 
how Cellar is doing it.
I see the instance directory being created but there is nothing in the log file 
of the child instance.

Thanks for the help!


> On Dec 2, 2015, at 10:34 AM, Jean-Baptiste Onofré <[email protected]> wrote:
> 
> It's @Ignore due to some hazelcast issue. I will re-enable it.
> 
> With Karaf 4.0.0, you can see:
> 
>    protected void createCellarChild(String name, boolean debug, int port) {
>        int instances = 0;
>        String createCommand = "instance:create --featureURL " + 
> System.getProperty("cellar.feature.url") + " --feature cellar ";
>        if (debug && port > 0) {
>            createCommand = createCommand + String.format(DEBUG_OPTS, port);
>        }
>        System.err.println(executeCommand(createCommand + " " + name));
>        System.err.println(executeCommand("instance:start " + name));
> 
>        //Wait till the node is listed as Starting
>        System.err.print("Waiting for " + name + " to start ");
>        for (int i = 0; i < 5 && instances == 0; i++) {
>            String response = executeCommand("instance:list | grep " + name + 
> " | grep -c " + INSTANCE_STARTED, COMMAND_TIMEOUT, true);
>            instances = Integer.parseInt(response.trim());
>            System.err.print(".");
>            try {
>                Thread.sleep(3000);
>            } catch (InterruptedException e) {
>                //Ignore
>            }
>        }
> 
>        if (instances > 0) {
>            System.err.println(".Started!");
>        } else {
>            System.err.println(".Timed Out!");
>        }
> 
>    }
> 
> It's what I used and it should work.
> 
> Do you do the same ?
> 
> Do you use the Instance service directly or the commands ?
> 
> Regards
> JB
> 
> On 12/02/2015 04:27 PM, Alex Soto wrote:
>> Downloaded Cellar from the Head at https://github.com/apache/karaf-cellar 
>> <https://github.com/apache/karaf-cellar>
>> All Integration Tests have the @Ignore annotation.
>> 
>> Is anybody able to launch a second Karaf instance from a Pax-Exam
>> integration test?
>> If so, can you point me to a working example?
>> 
>> 
>>> On Dec 1, 2015, at 3:12 PM, Alex Soto <[email protected] 
>>> <mailto:[email protected]>
>>> <mailto:[email protected] <mailto:[email protected]>>> wrote:
>>> 
>>> Hmm,  I tried downloading Cellar and all the mirrors fail with not
>>> found error.
>>> How do I get the source code?
>>> 
>>> 
>>>> On Dec 1, 2015, at 3:00 PM, Alex Soto <[email protected] 
>>>> <mailto:[email protected]>
>>>> <mailto:[email protected] <mailto:[email protected]>>> wrote:
>>>> 
>>>> JB:
>>>> 
>>>> Yes, it works outside of Pax-Exam.
>>>> I will take a look at Cellar.
>>>> 
>>>> Thanks
>>>> 
>>>>> On Dec 1, 2015, at 2:54 PM, Jean-Baptiste Onofré <[email protected] 
>>>>> <mailto:[email protected]>
>>>>> <mailto:[email protected] <mailto:[email protected]>>> wrote:
>>>>> 
>>>>> Hey Alex,
>>>>> 
>>>>> I guess it works fine "outside" of Pax Exam, right ?
>>>>> 
>>>>> You can take a look on Cellar as I use instance to simulate multiple
>>>>> nodes.
>>>>> 
>>>>> Let me try with 4.0.3.
>>>>> 
>>>>> Regards
>>>>> JB
>>>>> 
>>>>> On 12/01/2015 08:16 PM, Alex Soto wrote:
>>>>>> Hello,
>>>>>> 
>>>>>> I am using Karaf version 4.0.3. In my integration test I want to launch
>>>>>> a second instance of Karaf, but it always times out, so I am now
>>>>>> wondering if it is because the root instance is not yet finished
>>>>>> starting.
>>>>>> 
>>>>>> In order to troubleshoot this issue, I have now added the
>>>>>> ‘instance:list’ command to my test:
>>>>>> 
>>>>>> String listOutput = executeCommand("instance:list");
>>>>>> log.info(listOutput);
>>>>>> 
>>>>>> I call the above from my @Test method, but the output always shows:
>>>>>> 
>>>>>> SSH Port | RMI Registry | RMI Server | State    | PID  | Name
>>>>>> -------------------------------------------------------------
>>>>>>  8101 |         1099 |      44444 | Starting | 2914 | root
>>>>>> 
>>>>>> No matter how much I wait, it always shows the same status. Meaning the
>>>>>> container never finishes starting. I can manually run the exact same
>>>>>> container that was created under 'target/exam/<guid>’ folder, and issue
>>>>>> the above command and get:
>>>>>> 
>>>>>> SSH Port | RMI Registry | RMI Server | State   | PID  | Name
>>>>>> ------------------------------------------------------------
>>>>>>  8101 |         1099 |      44444 | Started | 3409 | root
>>>>>> 
>>>>>> So, it appears to be some kind of issue with the way the PAM-EXAM test
>>>>>> is wired.  I have added this dependency to try to cope with the
>>>>>> problem:
>>>>>> 
>>>>>> @Inject
>>>>>> @Filter(timeout = SERVICE_TIMEOUT)
>>>>>> protected BootFinished bootFinished;
>>>>>> 
>>>>>> but so far, I have not been able to solve it.  As I said before, my
>>>>>> ultimate goal is to run a child instance, but I suspect that won’t
>>>>>> happen until the main instance is successfully started.  Any hints?
>>>>>> 
>>>>>> Best regards,
>>>>>> Alex Soto
>>>>>> 
>>>>> 
>>>>> --
>>>>> Jean-Baptiste Onofré
>>>>> [email protected] <mailto:[email protected]> 
>>>>> <mailto:[email protected] <mailto:[email protected]>>
>>>>> http://blog.nanthrax.net <http://blog.nanthrax.net/>
>>>>> Talend - http://www.talend.com <http://www.talend.com/>
>>>> 
>>> 
>> 
> 
> -- 
> Jean-Baptiste Onofré
> [email protected] <mailto:[email protected]>
> http://blog.nanthrax.net <http://blog.nanthrax.net/>
> Talend - http://www.talend.com <http://www.talend.com/>

Reply via email to