← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~lgp171188/launchpad:fix-bugtask-query-count-test-failures into launchpad:master

 

Guruprasad has proposed merging ~lgp171188/launchpad:fix-bugtask-query-count-test-failures into launchpad:master.

Commit message:
Fix the query counts in the bugtask browser tests
 
The expected number of queries had increased with the changes to add a
UI for the bug lock status. This updates the failing tests with the
correct number of expected queries.


Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~lgp171188/launchpad/+git/launchpad/+merge/415649
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~lgp171188/launchpad:fix-bugtask-query-count-test-failures into launchpad:master.
diff --git a/lib/lp/bugs/browser/tests/test_bugtask.py b/lib/lp/bugs/browser/tests/test_bugtask.py
index 245ba07..55f3188 100644
--- a/lib/lp/bugs/browser/tests/test_bugtask.py
+++ b/lib/lp/bugs/browser/tests/test_bugtask.py
@@ -132,7 +132,7 @@ class TestBugTaskView(TestCaseWithFactory):
             0, 10, login_method=lambda: login(ADMIN_EMAIL))
         # This may seem large: it is; there is easily another 25% fat in
         # there.
-        self.assertThat(recorder1, HasQueryCount(LessThan(86)))
+        self.assertThat(recorder1, HasQueryCount(LessThan(89)))
         self.assertThat(recorder2, HasQueryCount.byEquality(recorder1))
 
     def test_rendered_query_counts_constant_with_attachments(self):
@@ -143,7 +143,7 @@ class TestBugTaskView(TestCaseWithFactory):
             lambda: self.getUserBrowser(url, person),
             lambda: self.factory.makeBugAttachment(bug=task.bug),
             1, 9, login_method=lambda: login(ADMIN_EMAIL))
-        self.assertThat(recorder1, HasQueryCount(LessThan(87)))
+        self.assertThat(recorder1, HasQueryCount(LessThan(90)))
         self.assertThat(recorder2, HasQueryCount.byEquality(recorder1))
 
     def makeLinkedBranchMergeProposal(self, sourcepackage, bug, owner):
@@ -178,7 +178,7 @@ class TestBugTaskView(TestCaseWithFactory):
         recorder1, recorder2 = record_two_runs(
             lambda: self.getUserBrowser(url, owner),
             make_merge_proposals, 0, 1)
-        self.assertThat(recorder1, HasQueryCount(LessThan(94)))
+        self.assertThat(recorder1, HasQueryCount(LessThan(97)))
         # Ideally this should be much fewer, but this tries to keep a win of
         # removing more than half of these.
         self.assertThat(
@@ -224,7 +224,7 @@ class TestBugTaskView(TestCaseWithFactory):
             lambda: self.getUserBrowser(url, person),
             lambda: add_activity("description", self.factory.makePerson()),
             1, 20, login_method=lambda: login(ADMIN_EMAIL))
-        self.assertThat(recorder1, HasQueryCount(LessThan(87)))
+        self.assertThat(recorder1, HasQueryCount(LessThan(90)))
         self.assertThat(recorder2, HasQueryCount.byEquality(recorder1))
 
     def test_rendered_query_counts_constant_with_milestones(self):
@@ -234,7 +234,7 @@ class TestBugTaskView(TestCaseWithFactory):
 
         with celebrity_logged_in('admin'):
             browses_under_limit = BrowsesWithQueryLimit(
-                87, self.factory.makePerson())
+                90, self.factory.makePerson())
 
         self.assertThat(bug, browses_under_limit)