One of the things that’s plagued our buildbot config for a while is how to know when the web servers are really up and ready to take requests. For a while, I had buildbot configured to just sleep for a while and then start running flunc. This would eventually fail when the box was under heavy load; the flunc tests would start when things weren’t ready . I suppose I could keep doubling the sleep time, but I wanted something more meaningful.
I finally came up with a hack that seems to be reliable - use wget to actually request a page from the app and block until it returns or times out. Something like this:
fac.addStep(ShellCommand,
command=('%s/bin/supervisord && sleep 10 && wget '
'--retry-connrefused --tries=10 -T 100 --spider '
'http://localhost:%d' % (OCBASEDIR, ports[1])),
description=['start services', 'for functional tests'],
haltOnFailure=True)
The full config (or rather, a template for it) can be seen in our source control here.
Another problem was that the services sometimes didn’t get shut down properly. I hacked a bit on jeff’s very handy portutils package until it seemed to do the trick.

No Comments
RSSNo comments yet.
Leave a comment