How do I ensure that only one of a certain category of job runs at once in Hudson?
Asked Answered
I

2

5

I use Hudson to automate the testing of a very large important product. I want to have my testing-hosts able to run as many concurrent builds as they will theoretically support with the exception of excel-tests which must only run one per machine at any time. Any number of non-excel tests can run concurrently, however at most one excel test at a time must run per machine.

Background:

Most of my tests are normal unit-tests - the sort of thing that I can easily run in parallel. Unfortunately a substantial and time consuming part of my unit-testing plan consists of tests which have been implemented in Excel.

You might think it crazy to implement a test in Excel - actually there's an important reason: Most of our users access our system via a Excel. Excel has it's own quirky ways of handling data so the only way to guarantee that our stuff works for Excel users is to literally implement our reg-test our application Excel.

I've written a test-runner tool which allows me to easily fire off a group of excel tests: Each test is a single .xls file. Each group is a folder full of excel files. I've got about 30 groups which need to be run for an end-to-end test. My tool converts the result of each of the tests into JUnit style XML which Hudson is able to understand. The tests use the pywin32com library to automate excel. When run on their own they are reliable.

I've got a group of computers which are dedicated to running tests. Each machine is quad-core and can theoretically run quite a lot of stuff at once. Unfortunately I've found that COM cannot be used to safely control more than 1 excel per machine at a time.

That is to say if a 2nd build stars which tries to talk to Excel via COM it might interfere with the one which is already running and cause both tests to fail.

I can run as many other non-excel processes as the machine will allow but I need to find a way so that Hudson does not attempt to launch any more than 1 process which requires excel on any one machine concurrently.

Insolation answered 5/2, 2009 at 17:15 Comment(1)
possible duplicate of How to prevent certain Jenkins jobs from running simultaneously?Denominator
B
5

Sounds like the Locks and Latches plugin might help you.

http://hudson.gotdns.com/wiki/display/HUDSON/Locks+and+Latches+plugin

Bandanna answered 5/2, 2009 at 19:13 Comment(1)
Locks and Latches is deprecated. See this answer for alternatives.Spelunker
G
0

Isn't hudson java?

Since you've tagged this post python, I'll point out that buildbot, has slave locks to limit individual steps on individual slaves (or use them as more coarse locks if you'd like).

Garek answered 5/2, 2009 at 18:17 Comment(1)
I'm testing a Python / Excel application in Hudson. Hudson is written in Java but I'm not actually doing any Java programming.Insolation

© 2022 - 2024 — McMap. All rights reserved.