Skip to content

Commit

Permalink
Fix try scheduler, mark test as no longer flaky
Browse files Browse the repository at this point in the history
This flaky test wasn't being run, and as a result we weren't seeing
the fact that the scheduler was subscribing to a nonexistent message
stream.

This also fixes a loop that would bail out on seeing just one
duplicate build, rather than simply skipping that build.  I doubt this
ever caused problems, but this is more correct.
  • Loading branch information
djmitche committed Aug 27, 2015
1 parent fe8686d commit bc078d8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
8 changes: 8 additions & 0 deletions master/buildbot/data/builds.py
Expand Up @@ -143,6 +143,14 @@ def get(self, resultSpec, kwargs):
buildscol.append(data)
defer.returnValue(buildscol)

def startConsuming(self, callback, options, kwargs):
builderid = kwargs.get('builderid')
if builderid is not None:
path = ('builders', str(builderid), 'builds', None, None)
else:
path = ('builds', None, None)
return self.master.mq.startConsuming(callback, path)


class Build(base.ResourceType):

Expand Down
2 changes: 1 addition & 1 deletion master/buildbot/schedulers/trysched.py
Expand Up @@ -289,7 +289,7 @@ def gotBuild(key, msg):
builds = yield self.master.data.get(('buildrequests', self.brid, 'builds'))
for build in builds:
if build['buildid'] in reportedBuilds:
return
continue
reportedBuilds.add(build['buildid'])
yield subscriber.callRemote('newbuild',
RemoteBuild(self.master, build, self.builderName),
Expand Down
4 changes: 1 addition & 3 deletions master/buildbot/test/integration/test_try_client.py
Expand Up @@ -23,7 +23,6 @@
from buildbot.schedulers import trysched
from buildbot.test.util import dirs
from buildbot.test.util import www
from buildbot.test.util.decorators import flaky
from twisted.cred import credentials
from twisted.internet import defer
from twisted.internet import reactor
Expand Down Expand Up @@ -133,7 +132,7 @@ def getSourceStamp(vctype, treetop, branch=None, repository=None):

# stub out printStatus, as it's timing-based and thus causes
# occasional test failures.
self.patch(tryclient.Try, 'printStatus', lambda: None)
self.patch(tryclient.Try, 'printStatus', lambda _: None)

def output(*msg):
msg = ' '.join(map(str, msg))
Expand Down Expand Up @@ -234,7 +233,6 @@ def test_userpass_no_wait(self):
buildsets = yield self.master.db.buildsets.getBuildsets()
self.assertEqual(len(buildsets), 1)

@flaky(bugNumber=2762)
@defer.inlineCallbacks
def test_userpass_wait(self):
yield self.startMaster(
Expand Down

0 comments on commit bc078d8

Please sign in to comment.