Skip to content
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

Merged
merged 1 commit into from
Nov 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions tests/integration_tests/core_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -714,10 +714,16 @@ def test_explore_json_async(self):
keys = list(data.keys())

# If chart is cached, it will return 200, otherwise 202
self.assertTrue(rv.status_code in {200, 202})
self.assertCountEqual(
keys, ["channel_id", "job_id", "user_id", "status", "errors", "result_url"]
)
assert rv.status_code in {200, 202}
Copy link
Member

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.

Copy link
Member Author

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.

if rv.status_code == 202:
assert keys == [
"channel_id",
"job_id",
"user_id",
"status",
"errors",
"result_url",
]

@pytest.mark.usefixtures("load_birth_names_dashboard_with_slices")
@mock.patch.dict(
Expand Down
Loading