launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #02596
[Merge] lp:~allenap/launchpad/new-builders-scanner-calm-down into lp:launchpad
Gavin Panella has proposed merging lp:~allenap/launchpad/new-builders-scanner-calm-down into lp:launchpad.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
Related bugs:
#718761 NewBuildersScanner schedules a new SlaveScanner every 5 minutes for new builders
https://bugs.launchpad.net/bugs/718761
For more details, see:
https://code.launchpad.net/~allenap/launchpad/new-builders-scanner-calm-down/+merge/49645
>From the bug report:
NewBuildersScanner does not update its record of current builders,
so any newly added builders will have a new SlaveScanner scheduled
every time it scans for new builders - every 5 minutes.
--
https://code.launchpad.net/~allenap/launchpad/new-builders-scanner-calm-down/+merge/49645
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~allenap/launchpad/new-builders-scanner-calm-down into lp:launchpad.
=== modified file 'lib/lp/buildmaster/manager.py'
--- lib/lp/buildmaster/manager.py 2010-11-26 15:16:53 +0000
+++ lib/lp/buildmaster/manager.py 2011-02-14 15:10:51 +0000
@@ -326,6 +326,7 @@
builder.name for builder in getUtility(IBuilderSet))
old_builders = set(self.current_builders)
extra_builders = new_builders.difference(old_builders)
+ self.current_builders.extend(extra_builders)
return list(extra_builders)
=== modified file 'lib/lp/buildmaster/tests/test_manager.py'
--- lib/lp/buildmaster/tests/test_manager.py 2010-12-20 03:21:03 +0000
+++ lib/lp/buildmaster/tests/test_manager.py 2011-02-14 15:10:51 +0000
@@ -555,6 +555,13 @@
self.assertEqual(
new_builders, builder_scanner.checkForNewBuilders())
+ def test_checkForNewBuilders_detects_builder_only_once(self):
+ # checkForNewBuilders() only detects a new builder once.
+ builder_scanner = self._getScanner()
+ LaunchpadObjectFactory().makeBuilder(name="sammy")
+ self.assertEqual(["sammy"], builder_scanner.checkForNewBuilders())
+ self.assertEqual([], builder_scanner.checkForNewBuilders())
+
def test_scan(self):
# See if scan detects new builders.