[ 
https://issues.apache.org/jira/browse/STRATOS-1628?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15020495#comment-15020495
 ] 

ASF GitHub Bot commented on STRATOS-1628:
-----------------------------------------

Github user ravihansa3000 commented on a diff in the pull request:

    https://github.com/apache/stratos/pull/492#discussion_r45546625
  
    --- Diff: 
products/stratos/modules/integration/test-common/src/main/java/org/apache/stratos/integration/common/extensions/StratosServerExtension.java
 ---
    @@ -107,11 +106,10 @@ private void startStratosServer(int 
activeMQDynamicPort) throws AutomationFramew
                 long time3 = System.currentTimeMillis();
                 String carbonHome = stratosTestServerManager.startServer();
                 assertNotNull(carbonHome, "CARBON_HOME is null");
    -            while (!serverStarted()) {
    -                log.info("Waiting for topology to be initialized...");
    -                Thread.sleep(5000);
    -            }
    -            while (!mockServiceStarted()) {
    +
    +            // checking whether mock iaas component is ready. If it is 
ready, all the components are activated.
    +            mockIaasApiClient = new 
MockIaasApiClient(stratosTestServerManager.getWebAppURL() + MOCK_IAAS_API_EP);
    +            while 
(!StratosServerExtension.mockIaasApiClient.isMockIaaSReady()) {
                     log.info("Waiting for mock service to be initialized...");
                     Thread.sleep(1000);
    --- End diff --
    
    Stratos server usually takes about 50 s to startup on average. I think we 
can wait for ~ 50s first before checking the status. Otherwise this message 
will be printed every 1s which will pollute the log.


> Improve the way intergration test determines whether the server is ready or 
> not
> -------------------------------------------------------------------------------
>
>                 Key: STRATOS-1628
>                 URL: https://issues.apache.org/jira/browse/STRATOS-1628
>             Project: Stratos
>          Issue Type: Improvement
>          Components: Integration Framework, Mock IaaS
>            Reporter: Rajkumar Rajaratnam
>            Assignee: Rajkumar Rajaratnam
>
> Currently, integrations test is looking at specific log messages to determine 
> whether the stratos server is ready to handle request or not. Proper way 
> would be to check with an API whether the server is ready or not. I propose 
> we need to handle this in the following way.
> a) exposing an API in mock API to check whether mock iaas is activated or not.
> b) integration tests should be started after getting a positive response from 
> the above API.
> As per our component start up order, the above solution will make sure that 
> every component is ready to handle requests.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to