-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix process flakes #540
Fix process flakes #540
Conversation
joseph-sentry
commented
Jul 4, 2024
- Fix bug where we weren't queuing up the process flakes task when we were supposed to
- Refine test instances query in process flakes
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. @@ Coverage Diff @@
## main #540 +/- ##
=======================================
Coverage 97.50% 97.51%
=======================================
Files 420 420
Lines 35402 35432 +30
=======================================
+ Hits 34520 34550 +30
Misses 882 882
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Codecov ReportAll modified and coverable lines are covered by tests ✅ ✅ All tests successful. No failed tests found. @@ Coverage Diff @@
## main #540 +/- ##
=======================================
Coverage 97.50% 97.51%
=======================================
Files 420 420
Lines 35402 35432 +30
=======================================
+ Hits 34520 34550 +30
Misses 882 882
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found @@ Coverage Diff @@
## main #540 +/- ##
=======================================
Coverage 97.50% 97.51%
=======================================
Files 420 420
Lines 35402 35432 +30
=======================================
+ Hits 34520 34550 +30
Misses 882 882
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## main #540 +/- ##
=======================================
Coverage 97.53% 97.53%
=======================================
Files 451 451
Lines 36125 36155 +30
=======================================
+ Hits 35233 35263 +30
Misses 892 892
Flags with carried forward coverage won't be shown. Click here to find out more.
This change has been scanned for critical changes. Learn more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
tasks/process_flakes.py
Outdated
test_instances = list( | ||
TestInstance.objects.filter( | ||
commitid=commit_id, repoid=repo_id, branch=branch | ||
Q(commitid=commit_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nit]
I think this can be refactored to be easier to read if you break up the conditions and give them a name
basic_filters = Q(commitid=commit_id) & Q(repoid=repo_id) & Q(branch=branch)
test_failed_filters = Q(outcome=TestInstance.Outcome.ERROR.value) | Q(outcome=TestInstance.Outcome.FAILURE.value)
test_already_flaky_filters= Q(outcome=TestInstance.Outcome.PASS.value) & Q(test_id__in=flaky_tests)
test_instances = list(
TestInstance.objects.filter(
basic_filters & (test_failed_filters | test_already_flaky_filters)
).all()
)
61748f0
to
397e78f
Compare
Previously the process flakes task would not be queued up in the test results finisher if we did not have a reason to notify and returned from the task early. That's wrong because even if we have only successes and are not notifying we should process successful test instances into existing flakes
We were previously getting all test instances related to a given repo, commit, branch combination. This is more than we actually need, we only need the test instances that had a failed outcome OR have a test id that matches an existing flake in our database. The goal of this change is to filter out a bunch of test instances that passed that aren't relevant to processing flakes.
Signed-off-by: joseph-sentry <joseph.sawaya@sentry.io>
397e78f
to
d80ff24
Compare