builders.py: fix bonus time calculation

Modify the builder_bonuses calculation so that it provides variable
bonus time based on the builder, rather than a constant value.

Signed-off-by: Trevor Gamblin <trevor.gamblin@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Trevor Gamblin 2021-10-29 11:17:55 -04:00 committed by Richard Purdie
parent fda674dec6
commit e21c1123a2

View File

@ -181,7 +181,7 @@ for builder in config.subbuilders:
# Add 2 seconds * length as the weight so tightly constrained builders go first
builder_bonuses = {}
for builder in config.builder_to_workers:
bonus = (len(config.workers) - len(config.builder_to_workers)) * 2
bonus = (len(config.workers) - len(config.builder_to_workers[builder])) * 2
builder_bonuses[builder] = timedelta(seconds=bonus)
# Modified default algothirm from buildbot with a bonus mechanism (thanks tardyp!)