-
Notifications
You must be signed in to change notification settings - Fork 13.9k
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: flaky test_explore_json_async test v2 #26106
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #26106 +/- ##
===========================================
- Coverage 69.10% 58.93% -10.18%
===========================================
Files 1940 1940
Lines 75869 75869
Branches 8445 8445
===========================================
- Hits 52427 44710 -7717
- Misses 21267 28984 +7717
Partials 2175 2175
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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. Thanks for the improvement!
self.assertCountEqual( | ||
keys, ["channel_id", "job_id", "user_id", "status", "errors", "result_url"] | ||
) | ||
assert rv.status_code in {200, 202} |
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.
@villebro I was wondering whether it would be easier/simpler to disable the caching for this test so the response status code is always 200. The only caveat is whether we should be testing both scenarios.
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.
@john-bodley yeah, totally. I tried to do that a long time ago, but things got really weird. I figured I'll rewrite this test when we start preparing for GAQ for real.
(cherry picked from commit 91a8b69)
SUMMARY
#26059 relaxed the assertion in
test_explore_json_async
to not fail if the result was already cached. However, since the response payload is different for the 202 response, the test still fails if a 200 is received. This PR changes the assertion from the legacyself.assert
notation to the preferredassert
one, and makes thekeys
assertion both conditional on a 202 response, and explicitly asserts the returned keys, instead of the key count.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION