Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sleep before pinging, instead of using -w/-c ping options.
Browse files Browse the repository at this point in the history
These options don't work if there's a possibility that the host
will not return ARP replies as then ping will exit immediately.
whitequark committed Nov 24, 2016
1 parent 569fe8d commit e411116
Showing 3 changed files with 26 additions and 2 deletions.
1 change: 1 addition & 0 deletions commands/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from .lit_test import LitTestCommand
from .coveralls import CoverallsCommand
from .xilinx import XilinxCommand
from .sleep import Sleep
18 changes: 18 additions & 0 deletions commands/delay.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from buildbot.process.buildstep import BuildStep
from buildbot.status.results import SUCCESS

class Sleep(BuildStep):
"""
A build step that does nothing for a predefined time.
"""
parms = BuildStep.parms + ['delay']

delay = None # in seconds

def start(self):
self.step_status.setText(["sleeping", "%g sec" % self.delay])
reactor.callLater(self.delay, self.finished, SUCCESS)

def finished(self, results):
self.step_status.setText(["sleeped", "%g sec" % self.delay])
buildstep.BuildStep.finished(self, results)
9 changes: 7 additions & 2 deletions master.cfg
Original file line number Diff line number Diff line change
@@ -89,7 +89,7 @@ from buildbot.steps.master import MasterShellCommand
from buildbot.steps.transfer import DirectoryUpload
from buildbot.steps.trigger import Trigger
from buildbot.process.properties import renderer
from commands import LitTestCommand, CoverallsCommand, XilinxCommand
from commands import LitTestCommand, CoverallsCommand, XilinxCommand, Sleep

conda_lock = locks.SlaveLock('conda', maxCount=1)

@@ -437,10 +437,15 @@ def addARTIQFlashSteps(factory, options, address):
env = condaEnv(use_local=True),
locks = default_locks))

factory.addStep(
Sleep(
delay = 10.0,
locks = default_locks))

factory.addStep(
MasterShellCommand(
name = 'ping',
command = ['ping', address, '-c30', '-w120'],
command = ['ping', address],
description = ['pinging', address],
descriptionDone = ['ping', address],
haltOnFailure = True,

0 comments on commit e411116

Please sign in to comment.