Merge lp:~adeuring/launchpad/bug-507642 into lp:launchpad
Status: | Merged |
---|---|
Approved by: | Jeroen T. Vermeulen |
Approved revision: | no longer in the source branch. |
Merged at revision: | not available |
Proposed branch: | lp:~adeuring/launchpad/bug-507642 |
Merge into: | lp:launchpad |
Diff against target: |
162 lines (+67/-12) 3 files modified
lib/canonical/launchpad/webapp/snapshot.py (+4/-1) lib/lp/bugs/interfaces/bug.py (+11/-10) lib/lp/bugs/tests/test_bugs_webservice.py (+52/-1) |
To merge this branch: | bzr merge lp:~adeuring/launchpad/bug-507642 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jeroen T. Vermeulen (community) | code | Approve | |
Review via email: mp+20978@code.launchpad.net |
Description of the change
This branch removes the properties IBug.subscriptions,
IBug.users_affected IBug.users_
IBug.users_
of IBug objects.
It is at present impossible to (un)subscribe from bug 1 via AJAX.
(other manipulations of bug 1 via the webservice API like marking
oneself as being affected by this bug don't work either.) Attempts
to do that lead to OOPSes as reported in bug 507642, bug 505999,
bug 534339. They are caused because a snapshot of the bug involves
making shortlist instances of the above mentioned properties in
snapshot_
to 1000, while bug 1 has meanwhile more than 1000 comments.
It would have been enough to mark IBug.messages with doNotSnapshot(),
but bug 1 has ca 300 subscribers and ca 200 people feel affected by
it, and I think that these numbers are close enough to the hard limit
to remove the related properties from the snapshot too.
In order to trigger the failure, we need a bug with "too many" comments,
subscribers or affected people. Instead of creating 1000 bug comments
or people just for the tests, I changed the hard limit for the
shortlist() calls for the tests.
main test:
./bin/test -t test_bugs_
possibly affected tests where snapshots of IBug objects are involved:
./bin/test -t test_bugtask -t test_bugnotific
= Launchpad lint =
Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.
Linting changed files:
lib/canonical
lib/lp/
lib/lp/
== Pylint notices ==
lib/canonical/
11: [F0401] Unable to import 'lazr.lifecycle
lib/lp/
36: [F0401] Unable to import 'lazr.lifecycle
52: [F0401] Unable to import 'lazr.restful.
58: [F0401] Unable to import 'lazr.restful.
59: [F0401] Unable to import 'lazr.restful.
506: [C0322, IBug.addAttachment] Operator not preceded by a space
comment=Text(), filename=
^
content_
@export_
def addAttachment(
content_
653: [C0322, IBug.getNominat
nominations
^
title=
value_
required=
@operation_
@export_
def getNominations(
733: [C0322, IBug.markUserAf
required=False, default=True))
^
@call_
@export_
def markUserAffecte
748: [C0322, IBug.setComment
required=True),
^
visible=
@call_
@export_
def setCommentVisib
760: [C0322, IBug.linkHWSubm
Interface, title=_('A HWDB submission'), required=True))
^
@export_
def linkHWSubmissio
767: [C0322, IBug.unlinkHWSu
Interface, title=_('A HWDB submission'), required=True))
^
@export_
def unlinkHWSubmiss
Hi Jeroen,
I added an explicit test that the collections are labeled as "do not snapshot". But I did not run the "full test" of too many subscritpions with the real hard limit, as you suggested: Doing this takes ca 80 second on my machine,even when factory. makePersonNoCim mit() is used. BTW, according to top(1), most time is spent in Python, not in Postgres during this test.