Skip to Content

HCP, Maven and CI

Hi,

I am playing around with the HCP maven plugin in a CI setup. My WAR app is exposing a JPA as OData via Olingo. When I want to execute my jMeter tests, they always fail. All my test are done locally, no cloud deploy (yet)

I seems that the local install of the WAR finishes too early. Maven set ups the local Neo instance, copies the WAR and then starts the jMeter tests. Neo takes a while to pick up the WAR, install and initialize it. During the setup time of the WAR, the jMeter tests are already executed and the local JEE server won`t send a waiting response.

When I only run the pre-integration target, Neo is installed, WAR copied, and after a while (2 minutes), the web application can be accessed by browser and works.

Now, is this just me? I am doing something wrong? Or do I have to wait for 1, 2 or more minutes until the WAR is 100% deployed and working?

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Best Answer
    Apr 05, 2016 at 12:16 PM

    Hi Tobias,

    there is no default way to determine whether an application deployed to a local server is running and ready for testing.

    The sample applications contained in the SDK available on the Tools Page demonstrate a Maven CI setup similar to yours.

    They utilize the waitUrl parameter in the start-local command.

    If provided the start-local command will block until the provided URL returns a 2xx response or the waitUrlTimeout is exceeded.

    This way you can ping any URL of your application to check if it is up, initialized and ready for testing.

    Regards, Eckart

    Add comment
    10|10000 characters needed characters exceeded

    • Thanks for helping.

      I was playing with the waitUrl parameter before, but I confess I do not really like it, but at least it works :-)

      I will have to validate this with a pure tomcat scenario, but I think that as soon as tomcat starts deploying a WAR, the URL is responsive and a client will wait (until a timeout is reached there too). At least this is what I recall from deploying WAR files to tomcat via maven.