Implementing random wait before git-fetching things
This commit is contained in:
parent
6260e0ddda
commit
1159ea34bf
1 changed files with 14 additions and 1 deletions
|
@ -14,6 +14,7 @@ from buildbot.steps.transfer import FileDownload
|
||||||
from buildbot.buildslave import BuildSlave
|
from buildbot.buildslave import BuildSlave
|
||||||
from gdbcommand import GdbCatSumfileCommand
|
from gdbcommand import GdbCatSumfileCommand
|
||||||
from json import load
|
from json import load
|
||||||
|
import random
|
||||||
|
|
||||||
|
|
||||||
## TODO:
|
## TODO:
|
||||||
|
@ -29,6 +30,11 @@ class DeleteGDBBuildDir (ShellCommand):
|
||||||
descriptionDone = "deleted previous GDB build directory"
|
descriptionDone = "deleted previous GDB build directory"
|
||||||
command = ['rm', '-rf', WithProperties ("%s/build", 'builddir')]
|
command = ['rm', '-rf', WithProperties ("%s/build", 'builddir')]
|
||||||
|
|
||||||
|
class RandomWaitForClone (ShellCommand):
|
||||||
|
description = "randomly waiting before git fetching"
|
||||||
|
descriptionDone = "waited before git fetching"
|
||||||
|
command = ['sleep', WithProperties ("%ss", 'randomWait')]
|
||||||
|
|
||||||
class CloneOrUpdateGDBMasterRepo (Git):
|
class CloneOrUpdateGDBMasterRepo (Git):
|
||||||
description = "fetching GDB master sources"
|
description = "fetching GDB master sources"
|
||||||
descriptionDone = "fetched GDB master sources"
|
descriptionDone = "fetched GDB master sources"
|
||||||
|
@ -39,6 +45,8 @@ class CloneOrUpdateGDBMasterRepo (Git):
|
||||||
'builddir'),
|
'builddir'),
|
||||||
retryFetch = True,
|
retryFetch = True,
|
||||||
mode = 'incremental')
|
mode = 'incremental')
|
||||||
|
self.haltOnFailure = False
|
||||||
|
self.flunkOnFailure = False
|
||||||
|
|
||||||
class CloneOrUpdateGDBRepo (Git):
|
class CloneOrUpdateGDBRepo (Git):
|
||||||
description = "fetching GDB sources"
|
description = "fetching GDB sources"
|
||||||
|
@ -116,6 +124,9 @@ class BuildAndTestGDBFactory (factory.BuildFactory):
|
||||||
def __init__ (self, architecture_triplet = []):
|
def __init__ (self, architecture_triplet = []):
|
||||||
factory.BuildFactory.__init__ (self)
|
factory.BuildFactory.__init__ (self)
|
||||||
self.addStep (DeleteGDBBuildDir ())
|
self.addStep (DeleteGDBBuildDir ())
|
||||||
|
# Unfortunately we need to have this random wait, otherwise
|
||||||
|
# git fetch won't work
|
||||||
|
self.addStep (RandomWaitForClone ())
|
||||||
self.addStep (CloneOrUpdateGDBMasterRepo ())
|
self.addStep (CloneOrUpdateGDBMasterRepo ())
|
||||||
self.addStep (CloneOrUpdateGDBRepo ())
|
self.addStep (CloneOrUpdateGDBRepo ())
|
||||||
|
|
||||||
|
@ -180,9 +191,11 @@ def load_config (c):
|
||||||
config = load (open ("lib/config.json"))
|
config = load (open ("lib/config.json"))
|
||||||
passwd = load (open ("lib/passwords.json"))
|
passwd = load (open ("lib/passwords.json"))
|
||||||
|
|
||||||
|
random.seed ()
|
||||||
c['slaves'] = [BuildSlave (slave['name'], passwd[slave['name']],
|
c['slaves'] = [BuildSlave (slave['name'], passwd[slave['name']],
|
||||||
max_builds = 1,
|
max_builds = 1,
|
||||||
properties = { 'jobs' : slave['jobs'] })
|
properties = { 'jobs' : slave['jobs'],
|
||||||
|
'randomWait' : "%d" % random.randrange (1, 30) })
|
||||||
for slave in config['slaves']]
|
for slave in config['slaves']]
|
||||||
|
|
||||||
c['schedulers'] = []
|
c['schedulers'] = []
|
||||||
|
|
Loading…
Reference in a new issue