From 7068136e490a0eb983d93a922ce71d10d6efabae Mon Sep 17 00:00:00 2001 From: Armen Zambrano G <44410+armenzg@users.noreply.github.com> Date: Wed, 25 Sep 2024 09:30:37 -0700 Subject: [PATCH] A few more changes --- tests/snuba/test_deletes.py | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/tests/snuba/test_deletes.py b/tests/snuba/test_deletes.py index 678ffda8892ece..da9913678453fb 100644 --- a/tests/snuba/test_deletes.py +++ b/tests/snuba/test_deletes.py @@ -13,7 +13,7 @@ class SnubaTest(TestCase, SnubaTestCase): def test_basic(self) -> None: # insert a new issue now = datetime.now() - id = uuid4() + occurrence_id = uuid4() issue = ( 2, "insert", @@ -55,20 +55,22 @@ def test_basic(self) -> None: app_id="my_app", query=DeleteQuery( StorageKey.SearchIssues.value, - {"project_id": [self.project.id], "occurrence_id": [str(id)]}, + {"project_id": [self.project.id], "occurrence_id": [str(occurrence_id)]}, ), tenant_ids={"referrer": "testing.test", "organization_id": 1}, ) snuba.raw_snql_query(req, use_cache=False) - assert ( - snuba.query( - dataset=Dataset.IssuePlatform, - start=now - timedelta(days=1), - end=now + timedelta(days=1), - groupby=["project_id"], - filter_keys={"project_id": [self.project.id]}, - referrer="testing.test", - tenant_ids={"referrer": "testing.test", "organization_id": 1}, - ) - == {} + time.sleep(4) + + # check that it's gone + response = snuba.query( + dataset=Dataset.IssuePlatform, + start=now - timedelta(days=1), + end=now + timedelta(days=1), + groupby=["project_id"], + filter_keys={"project_id": [self.project.id]}, + referrer="testing.test", + tenant_ids={"referrer": "testing.test", "organization_id": 1}, + use_cache=False, ) + assert response == {}