Merge lp:~frankban/launchpad/bug-1038253-intermittent-failure into lp:launchpad

Proposed by Francesco Banconi on 2012-08-24
Status: Merged
Approved by: Brad Crittenden on 2012-08-24
Approved revision: no longer in the source branch.
Merged at revision: 15871
Proposed branch: lp:~frankban/launchpad/bug-1038253-intermittent-failure
Merge into: lp:launchpad
Diff against target: 18 lines (+2/-2)
1 file modified
lib/lp/bugs/browser/tests/test_bugtask.py (+2/-2)
To merge this branch: bzr merge lp:~frankban/launchpad/bug-1038253-intermittent-failure
Reviewer Review Type Date Requested Status
Brad Crittenden (community) code 2012-08-24 Approve on 2012-08-24
Review via email: mp+121143@code.launchpad.net

Commit Message

Fixed test_rendered_query_counts_constant_with_team_memberships isolation failure.

Description of the Change

= Summary =

test_rendered_query_counts_constant_with_team_memberships (in lp.bugs.browser.tests.test_bugtask.TestBugTaskView) failed during a parallel test run.

This is an isolation error:
- when run in isolation, the test performs 94 queries (and fails)
- when run as part of the TestCase, the test performs 93 queries
- the comment in the test said that in isolation the query count is 89
- the test asserted the query count is less than 94

== Implementation ==

Now the comment in test mentions the correct number of queries, and the assertion is fixed (less than 95).
The goal of the test, AFAICT, is to ensure the query count does not change adding teams to the person. Increasing the number of queries in the assertion is a fast fix that does not invalidate this goal.

NO Qa.

== Lint ==

Linting changed files:
  lib/lp/bugs/browser/tests/test_bugtask.py

To post a comment you must log in.
Brad Crittenden (bac) wrote :

thanks.

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/bugs/browser/tests/test_bugtask.py'
2--- lib/lp/bugs/browser/tests/test_bugtask.py 2012-08-27 23:58:18 +0000
3+++ lib/lp/bugs/browser/tests/test_bugtask.py 2012-08-28 09:39:20 +0000
4@@ -140,12 +140,12 @@
5 self.getUserBrowser(url, person_no_teams)
6 # This may seem large: it is; there is easily another 30% fat in
7 # there.
8- # If this test is run in isolation, the query count is 89.
9+ # If this test is run in isolation, the query count is 94.
10 # Other tests in this TestCase could cache the
11 # "SELECT id, product, project, distribution FROM PillarName ..."
12 # query by previously browsing the task url, in which case the
13 # query count is decreased by one.
14- self.assertThat(recorder, HasQueryCount(LessThan(94)))
15+ self.assertThat(recorder, HasQueryCount(LessThan(95)))
16 count_with_no_teams = recorder.count
17 # count with many teams
18 self.invalidate_caches(task)