From ea65c2467cee28d2e5a13ed1ec0cc65e71f11127 Mon Sep 17 00:00:00 2001 From: "Michael S. Molina" <70410625+michael-s-molina@users.noreply.github.com> Date: Wed, 22 Nov 2023 09:11:09 -0300 Subject: [PATCH] fix: Flaky test_explore_json_async test (#26059) Co-authored-by: John Bodley <4567245+john-bodley@users.noreply.github.com> (cherry picked from commit 2b88225ee113062ad1c108e28a8b41a7a04a0a1a) --- tests/integration_tests/core_tests.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/integration_tests/core_tests.py b/tests/integration_tests/core_tests.py index 191d9dc2d03..193cc570313 100644 --- a/tests/integration_tests/core_tests.py +++ b/tests/integration_tests/core_tests.py @@ -839,7 +839,8 @@ class TestCore(SupersetTestCase, InsertChartMixin): data = json.loads(rv.data.decode("utf-8")) keys = list(data.keys()) - self.assertEqual(rv.status_code, 202) + # 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"] )