Skip to content

Commit

Permalink
Only file bugs if grouper previously looked at the testcase. (#2535)
Browse files Browse the repository at this point in the history
* Only file bugs if grouper previous looked at the testcase.

Part of #2533.

* lint
  • Loading branch information
oliverchang authored Jan 20, 2022
1 parent 86719be commit 7b98873
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/appengine/handlers/cron/grouper.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,7 @@ def _key_func(testcase):
else:
group_id_with_testcases_map[testcase.group_id].append(testcase)

for group_id in group_id_with_testcases_map:
testcases_in_group = group_id_with_testcases_map[group_id]
for testcases_in_group in group_id_with_testcases_map.values():
if len(testcases_in_group) <= GROUP_MAX_TESTCASE_LIMIT:
continue

Expand Down Expand Up @@ -347,8 +346,9 @@ def group_testcases():
(testcase.group_bug_information != updated_group_bug_information) or
(testcase.is_leader != updated_is_leader))

testcase.set_metadata('ran_grouper', True, update_testcase=False)
if not is_changed:
# If nothing is changed, no more work to do. It's faster this way.
testcase.put()
continue

testcase.group_bug_information = updated_group_bug_information
Expand Down
8 changes: 8 additions & 0 deletions src/appengine/handlers/cron/triage.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,9 @@ class Handler(base_handler.Handler):
def get(self):
"""Handle a get request."""
try:
logs.log('Grouping testcases.')
grouper.group_testcases()
logs.log('Grouping done.')
except:
logs.log_error('Error occurred while grouping test cases.')
return
Expand Down Expand Up @@ -332,10 +334,16 @@ def get(self):
# to account for that.
# FIXME: In future, grouping might be dependent on regression range, so we
# would have to add an additional wait time.
# TODO(ochang): Remove this after verifying that the `ran_grouper`

This comment has been minimized.

Copy link
@mi-ac

mi-ac May 11, 2023

Contributor

Did you get a chance to verify this? Otherwise I think test cases that skip grouping (e.g. correctness fuzzing in the CRASH_TYPES_WITH_UNIQUE_STATE list) might have an unnecessary 4 hour delay until a bug is filed...

# metadata works well.
if not testcase.group_id and not dates.time_has_expired(
testcase.timestamp, hours=data_types.MIN_ELAPSED_TIME_SINCE_REPORT):
continue

if not testcase.get_metadata('ran_grouper'):
# Testcase should be considered by the grouper first before filing.
continue

# If this project does not have an associated issue tracker, we cannot
# file this crash anywhere.
issue_tracker = issue_tracker_utils.get_issue_tracker_for_testcase(
Expand Down

0 comments on commit 7b98873

Please sign in to comment.