Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(105)

Issue 2449853012: [Predator] Fix bug in min_distance after refactor and add back skip added/deleted deps. (Closed)

Created:
4 years, 1 month ago by Sharu Jiang
Modified:
4 years, 1 month ago
Reviewers:
wrengr, stgao
CC:
chromium-reviews, infra-reviews+infra_chromium.org, chanli, lijeffrey, ymzhang1, Martin Barbella
Target Ref:
refs/heads/master
Project:
infra
Visibility:
Public.

Description

[Predator] Fix bug in min_distance after refactor and add back skip added/deleted deps. Also added culprit_test for culprit.py BUG=660621, 659346 Committed: https://chromium.googlesource.com/infra/infra/+/e50200467b7e522a03b2d9d73d6cd27d0b49874c

Patch Set 1 #

Patch Set 2 : Add culprit test. #

Total comments: 13

Patch Set 3 : Fix nits. #

Patch Set 4 : Check suspected_cls in ToPublishableResult #

Patch Set 5 : Rebase and add logging. #

Patch Set 6 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+147 lines, -54 lines) Patch
M appengine/findit/crash/changelist_classifier.py View 1 2 3 4 2 chunks +19 lines, -3 lines 0 comments Download
M appengine/findit/crash/culprit.py View 1 2 2 chunks +7 lines, -9 lines 0 comments Download
M appengine/findit/crash/scorers/min_distance.py View 2 chunks +4 lines, -4 lines 0 comments Download
M appengine/findit/crash/scorers/test/aggregated_scorer_test.py View 3 chunks +9 lines, -8 lines 0 comments Download
M appengine/findit/crash/scorers/test/min_distance_test.py View 5 chunks +9 lines, -7 lines 0 comments Download
M appengine/findit/crash/test/changelist_classifier_test.py View 1 2 11 chunks +55 lines, -13 lines 0 comments Download
A appengine/findit/crash/test/culprit_test.py View 1 2 1 chunk +39 lines, -0 lines 0 comments Download
M appengine/findit/crash/test/findit_for_chromecrash_test.py View 1 2 2 chunks +1 line, -8 lines 0 comments Download
M appengine/findit/model/crash/crash_analysis.py View 1 2 3 4 3 chunks +4 lines, -2 lines 0 comments Download

Messages

Total messages: 23 (14 generated)
Sharu Jiang
PTAL :)
4 years, 1 month ago (2016-10-29 01:26:21 UTC) #3
wrengr
lgtm, with nits. https://codereview.chromium.org/2449853012/diff/60001/appengine/findit/crash/culprit.py File appengine/findit/crash/culprit.py (right): https://codereview.chromium.org/2449853012/diff/60001/appengine/findit/crash/culprit.py#newcode101 appengine/findit/crash/culprit.py:101: result['regression_range'] = self.regression_range self.regression_range stores a ...
4 years, 1 month ago (2016-10-31 23:48:35 UTC) #8
Sharu Jiang
https://codereview.chromium.org/2449853012/diff/60001/appengine/findit/crash/culprit.py File appengine/findit/crash/culprit.py (right): https://codereview.chromium.org/2449853012/diff/60001/appengine/findit/crash/culprit.py#newcode101 appengine/findit/crash/culprit.py:101: result['regression_range'] = self.regression_range On 2016/10/31 23:48:35, wrengr wrote: > ...
4 years, 1 month ago (2016-11-01 23:54:09 UTC) #9
stgao
lgtm
4 years, 1 month ago (2016-11-02 01:11:27 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2449853012/120001
4 years, 1 month ago (2016-11-02 01:35:52 UTC) #15
commit-bot: I haz the power
Try jobs failed on following builders: Infra Win Tester on luci.infra.try (JOB_FAILED, https://luci-milo.appspot.com/swarming/task/323b7f450e9d9910)
4 years, 1 month ago (2016-11-02 01:43:23 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2449853012/140001
4 years, 1 month ago (2016-11-02 02:40:07 UTC) #20
commit-bot: I haz the power
Committed patchset #6 (id:140001) as https://chromium.googlesource.com/infra/infra/+/e50200467b7e522a03b2d9d73d6cd27d0b49874c
4 years, 1 month ago (2016-11-02 03:08:23 UTC) #22
wrengr
4 years, 1 month ago (2016-11-03 16:14:33 UTC) #23
Message was sent while issue was closed.
https://codereview.chromium.org/2449853012/diff/60001/appengine/findit/crash/...
File appengine/findit/crash/test/culprit_test.py (right):

https://codereview.chromium.org/2449853012/diff/60001/appengine/findit/crash/...
appengine/findit/crash/test/culprit_test.py:13: self.assertEqual(culprit.fields,
('project', 'components', 'cls',
On 2016/11/01 23:54:09, sharu jiang wrote:
> On 2016/10/31 23:48:35, wrengr wrote:
> > N.B., this is fragile. In general Culprit is not defined when the
> > ``regression_range`` is None rather than a pair
> 
> Actually we can still get suspected_project and suspected_components from
crash
> stack even though we cannot find any regression_range.
> 
> We return None only when there is no parsed stacktrace object.

No, FindCulprit should return None (or rather: not return a Culprit) whenever it
fails for any reason. The regression_range is a required field for the
CrashReport, which Predator.FindCulprit takes as an argument, therefore
regression_range is guaranteed to be provided in every Culprit that
Predator.FindCulprit returns, thus the semantics of Culprit also have
regression_range be required.

https://codereview.chromium.org/2449853012/diff/60001/appengine/findit/crash/...
appengine/findit/crash/test/culprit_test.py:16: culprit = Culprit(None, None,
None, None, None)
On 2016/11/01 23:54:09, sharu jiang wrote:
> On 2016/10/31 23:48:35, wrengr wrote:
> > Again, this is fragile. Culprit expects all the fields to actually be
defined.
> 
> Still, it's possible that some of those fields are empty. This is just to test
> we can successfully drop those empty fields.
> 
> So it's possible that we return Culprit('', [], [], [], 'core_algorithm') if
we
> failed detecting regression range and all the classifiers failed.

No, again. The Culprit class is defined to encapsulate the successful results of
Predator.FindCulprit. The regression_range is provided by the CrashReport, and
therefore is always available. Similarly, the algorithm always knows about
itself, therefore Culprit.algorithm can always be filled in. For the cls and
components, "failure" means returning the empty list of alternatives; None
should not be used as it is not iterable. For the project, since the empty
string is an invalid project name, we do not want to distinguish between '' vs
None. Therefore, none of the fields should ever be None. Allowing any of the
fields to be None means all the consumers of Culprits must go through and add a
bunch of boilerplate to deal with ruling out Culprits that don't make sense in
the first place. The whole point of making Culprit a class rather than an
arbitrary dict is precisely to capture these invariants.

I can add code to Culprit.__init__ to check all these invariants, if you'd
prefer. I've avoided doing so only because that's against Python's spirit of
"consenting adults" (which I disagree with, but well, Python culture is Python
culture).

Powered by Google App Engine
This is Rietveld 408576698