Skip to content

Commit

Permalink
p4poller: do not rely on server time to get a list of changes
Browse files Browse the repository at this point in the history
  • Loading branch information
thedylman committed Sep 22, 2015
1 parent 0a9d657 commit 77eebef
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion master/buildbot/changes/p4poller.py
Expand Up @@ -214,7 +214,7 @@ def _poll(self):
args.extend(['-P', self._getPasswd()])
args.extend(['changes'])
if self.last_change is not None:
args.extend(['%s...@%d,now' % (self.p4base, self.last_change + 1)])
args.extend(['%s...@%d,#head' % (self.p4base, self.last_change + 1)])
else:
args.extend(['-m', '1', '%s...' % (self.p4base,)])

Expand Down
8 changes: 4 additions & 4 deletions master/buildbot/test/unit/test_changes_p4poller.py
Expand Up @@ -134,7 +134,7 @@ def do_test_poll_successful(self, **kwargs):
**kwargs))
self.expectCommands(
gpo.Expect('p4', 'changes', '-m', '1', '//depot/myproject/...').stdout(first_p4changes),
gpo.Expect('p4', 'changes', '//depot/myproject/...@2,now').stdout(second_p4changes),
gpo.Expect('p4', 'changes', '//depot/myproject/...@2,#head').stdout(second_p4changes),
)
encoded_p4change = p4change.copy()
encoded_p4change[3] = encoded_p4change[3].encode(encoding)
Expand Down Expand Up @@ -236,7 +236,7 @@ def test_poll_failed_describe(self):
p4base='//depot/myproject/',
split_file=lambda x: x.split('/', 1)))
self.expectCommands(
gpo.Expect('p4', 'changes', '//depot/myproject/...@3,now').stdout(second_p4changes),
gpo.Expect('p4', 'changes', '//depot/myproject/...@3,#head').stdout(second_p4changes),
)
self.add_p4_describe_result(2, p4change[2])
self.add_p4_describe_result(3, 'Perforce client error:\n...')
Expand Down Expand Up @@ -302,7 +302,7 @@ def test_poll_split_file(self):
p4base='//depot/myproject/',
split_file=get_simple_split))
self.expectCommands(
gpo.Expect('p4', 'changes', '//depot/myproject/...@51,now').stdout(third_p4changes),
gpo.Expect('p4', 'changes', '//depot/myproject/...@51,#head').stdout(third_p4changes),
)
self.add_p4_describe_result(5, p4change[5])

Expand Down Expand Up @@ -356,7 +356,7 @@ def test_server_tz(self):
split_file=get_simple_split,
server_tz="Europe/Berlin"))
self.expectCommands(
gpo.Expect('p4', 'changes', '//depot/myproject/...@51,now').stdout(third_p4changes),
gpo.Expect('p4', 'changes', '//depot/myproject/...@51,#head').stdout(third_p4changes),
)
self.add_p4_describe_result(5, p4change[5])

Expand Down
2 changes: 2 additions & 0 deletions master/docs/relnotes/index.rst
Expand Up @@ -32,6 +32,8 @@ Fixes

* :bb:chsrc:`GerritChangeSource` is now less verbose by default, and has a ``debug`` option to enable the logs.

* :bb:chsrc:`P4Source` no longer relies on the perforce server time to poll for new changes.

Deprecations, Removals, and Non-Compatible Changes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down

0 comments on commit 77eebef

Please sign in to comment.