-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: improve observability when bootstrapping scheduled tasks (#25210)
- Loading branch information
Showing
2 changed files
with
34 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from django.test import TestCase | ||
|
||
from posthog.celery import app | ||
from posthog.tasks.scheduled import setup_periodic_tasks | ||
|
||
|
||
class TestScheduledTasks(TestCase): | ||
def test_scheduled_tasks(self) -> None: | ||
""" | ||
`setup_periodic_tasks` may fail silently. This test ensures that it doesn't. | ||
""" | ||
try: | ||
setup_periodic_tasks(app) | ||
except Exception as exc: | ||
assert exc is None, exc |