Skip to content

Commit

Permalink
Apply Sebastian's suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
vrigal committed Mar 25, 2024
1 parent cc7d07b commit 07c607b
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/log_parser/test_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,26 @@ def test_bug_suggestion_line(
),
modified="2010-01-01 00:00:00",
)

# Create 50 other results with an inferior ID.
# The bug suggestions SQL query fetches up to 50 rows, ordered by match rank then ID.
# In case results are returned with a wrong rank (e.g. 0 for each result), above related suggestion will be lost.
Bugscache.objects.bulk_create(
[
Bugscache(
id=100 + i,
status="2",
keywords="intermittent-failure,intermittent-testcase",
summary=(
f"Intermittent browser/components/urlbar/tests/browser/browser_unrelated_{i}.js "
"| single tracking bug"
),
modified="2010-01-01 00:00:00",
)
for i in range(50)
]
)

error = job.text_log_error.first()
summary, line_cache = bug_suggestions_line(
error,
Expand Down

0 comments on commit 07c607b

Please sign in to comment.