-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(symbolicator): Correctly start tasks asynchronously (#29048)
- Loading branch information
1 parent
1479539
commit 87063c8
Showing
2 changed files
with
13 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,24 @@ | ||
import pytest | ||
|
||
from sentry.tasks.low_priority_symbolication import calculation_magic | ||
from sentry.processing import realtime_metrics | ||
from sentry.tasks.low_priority_symbolication import _scan_for_suspect_projects, calculation_magic | ||
from sentry.testutils.helpers.task_runner import TaskRunner | ||
from sentry.utils import redis | ||
from sentry.utils.compat import mock | ||
|
||
|
||
@pytest.fixture | ||
def redis_cluster() -> redis._RedisCluster: | ||
return redis.redis_clusters.get("default") | ||
|
||
|
||
@mock.patch("sentry.tasks.low_priority_symbolication.calculation_magic", lambda x, y: True) | ||
def test_scan_for_suspect_projects() -> None: | ||
realtime_metrics.increment_project_event_counter(17, 0) | ||
with TaskRunner(): | ||
_scan_for_suspect_projects() | ||
assert realtime_metrics.get_lpq_projects() == {17} | ||
|
||
|
||
def test_calculation_magic(): | ||
assert not calculation_magic([], []) |