[openstack-dev] [api] [gabbi] gabbi can poll now
chdent at redhat.com
Fri Jun 12 10:44:30 UTC 2015
In various discussion with some of the projects, on this list and at
summit, one of the holdups on people being able to adopt gabbi as a
tool for HTTP API testing in their own stuff was because they had
request handlers that return 202 in response to a POST and the created
resource would not be immediately available (for further testing).
Or similarly time-ambiguous situations.
The latest release of gabbi has a way to handle this. A 'poll' key
has been added to the test language. Here's an example of how it
might be used:
- name: create something async
- name: poll for created resource
count: 10 # try up to ten times
delay: .5 # wait .5 seconds between each try
The second request will repeat itself every .5 seconds until either
one of the following is true:
* It has tried ten times. In this case, the most recent test
assertion failure will be raised.
* The test passes.
This is rope that can hang your tests. Be cautious and conservative
This just went up on pypi as the somewhat bizarrely numbered version
As always if you're thinking of using it and want some help, have
questions, etc please feel free to find me (or jasonamyers).
 I was in a feature freeze at 0.99.x and the need for this feature beat
the race to get to version 1.0 and I want 1.0 to be the _actual_
public and frozen API.
Chris Dent tw:@anticdent freenode:cdent
More information about the OpenStack-dev