Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration tests - Ensure that web services and ROS services are deployed before execution #327

Open
klpanagi opened this issue Jun 6, 2016 · 2 comments

Comments

@klpanagi
Copy link
Contributor

klpanagi commented Jun 6, 2016

This issue is mostly related to Continues Integration. Executing integration-tests must ensure that the RAPP Platform was previously fully deployed in order to prevent from getting either HTTP request or ROS Service request errors.

For RAPP Platform scalability purposes, this should not be resolved using sleeping methods because
sleeping time values depends both on the physical machine hosting the RAPP Platform and the load of the RAPP Platform (ROS Nodes, Web Services).

etsardou added a commit that referenced this issue Jun 8, 2016
@etsardou
Copy link
Member

etsardou commented Jun 8, 2016

Tried to assess this issue like this.

I used a simple countdown timer in each test class (essentially for each web service), which polls the web service till it is up. I think using a timer with sleep is correct, since we must have an upper time limit while waiting for the services or else the call will hang forever. A drawback of this approach is that the countdown will exist for each inner test (e.g. in this file we will have 9 countdowns). We could check all the services in the rapp_testing_core.py file but this creates dependencies. Using the current approach each test file checks only its own web service.

In this example I am performing an erroneous call (just to get the response quickly) and I check if I get a connection error. The problem I found is this:

In the case when the web services are not up, the code executes fine and the timer times out correctly, raising a unittest assertion. If I launch the web services during the count down, the call immediately does not return connection error since it sees that the IP/Port combination is up, nevertheless, this does not mean that the specific web service is yet up, giving this response and causing all tests to fail:

.404 Client Error: Not Found for url: http://155.207.19.229:9001/hop/cognitive_test_chooser
('Connection aborted.', BadStatusLine("''",))

@klpanagi
Copy link
Contributor Author

klpanagi commented Jun 8, 2016

It is expected to have this behavior. Like you mentioned, connection error is different than HTTP 404.
We have to poll the service's url path until it is fully initialized and accessible through the www.
Using timers for polling, until we get an active connection, will ensure that we always get an active connection no matter of the time needed for the Platform to launch.

klpanagi pushed a commit that referenced this issue Jun 29, 2016
athallas pushed a commit that referenced this issue Jul 1, 2016
athallas added a commit that referenced this issue Jul 1, 2016
* integration_tests_issue_285:
  Work towards #285. Several bug fixes in the API are necessary for this branch to pass all integration tests
  Added error type calls for cognitive record tests
  Work on #285 and #327
@etsardou etsardou added this to the FutureWork milestone Nov 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants