[Buildbot-devel] Port reservation for functional testing

Georges Racinet gracinet at anybox.fr
Mon May 28 11:22:57 UTC 2012


is there a standard way to have an application launched on the slave  
on a free port and use that port number in subsequent steps ?

Example use-case : launch a web application in build step #n, launch  
selenium tests in build step #(n+1). Imagine there can be dozens of  
other services, including several build slaves for different masters  
on the same host.
We also have cases to test in which two applications have to  
communicate to finish their installation, before integration tests can  
be run.

Unfortunately, binding to the "0" port is not guaranteed to be  
accepted by all applications configuration logic, and reading the  
chosen port before hand from the logs (not guaranteed to be there  
either, although really common) leads to cumbersome application- 
dependent analysis, and we're looking for uniformity.

It wouldn't be too hard to have step #(n-1) bind to a port, free it  
and store the number in a property. A SetProperty step launching a  
small python script could do it. A lock to avoid race conditions in  
one given slave plus a range parameter to isolate slaves running on  
the same host should protect against race conditions.

What do you think ? Would a generic step subclass to do this be  
considered a useful contrib to Buildbot ?


More information about the devel mailing list