[users at bb.net] How to identify worker name from inside Python?

Chris Spencer chrisspen at gmail.com
Thu May 25 01:35:22 UTC 2017


>You can run more than one build at a time with a single worker.
>You can run more than one builder at a time on a single worker...

Really? How? Why does a worker only run one build at a time by default?

On Wed, May 24, 2017 at 8:21 PM, Bill Deegan <bill at baddogconsulting.com>
wrote:

> Why a second worker?
> You can run more than one build at a time with a single worker.
> You can run more than one builder at a time on a single worker...
>
> Putting all that aside, you can use the buildbot property 'workername' to
> do this.
> via command line arg, or set an environment variable, etc..
> http://docs.buildbot.net/latest/manual/cfg-buildsteps.
> html#using-shellcommands
> search for env=
>
> -Bill
>
>
> On Wed, May 24, 2017 at 3:12 PM, Chris Spencer <chrisspen at gmail.com>
> wrote:
>
>> I'm trying to setup a second worker on a server, and I'm running into
>> some issues with Firefox+Selenium+Xvfb used with some GUI tests.
>>
>> I'm currently spinning up an instance of Xvfb, since the server is
>> headless, but now that I have two workers, they're breaking each others
>> tests because each tries to cleanup the other's instance of Xvfb.
>>
>> Is there any way, from inside the Python test, to determine the worker
>> that's executing it? If I can identify some unique property of the process,
>> I can use that to set separate port numbers. I was thinking of just using
>> the process ID, but that alone wouldn't tell me which of the Nth workers
>> the process is running as.
>>
>> The idea is if my test knows it's running as "worker1", it can strip out
>> the 1, and append that to a base port number, e.g. 8000+1, to use for Xfvb,
>> and only manage the Xvfb process using that port.
>>
>> _______________________________________________
>> users mailing list
>> users at buildbot.net
>> https://lists.buildbot.net/mailman/listinfo/users
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.buildbot.net/pipermail/users/attachments/20170524/6b4072e1/attachment.html>


More information about the users mailing list