Flaky test: tests/sentry/api/test_permissions.py::IsAuthenticatedPermissionsTest::test_has_object_permission
Open
Nobody has claimed this yet.
flaky-test
Tests
- Dominant language
- Python
- Stars
- 44.8k
- Forks
- 4.9k
- Avg merge
- 21h 23m
- Merged PRs (30d)
- 607
Description
Failing test: tests/sentry/api/test_permissions.py::IsAuthenticatedPermissionsTest::test_has_object_permission
Sentry sha: ab471d2d1ede60c8a8c1e3911b78a71a83261eae
Run: https://github.com/getsentry/sentry/actions/runs/22271635213
[1m[31mtests/sentry/api/test_permissions.py[0m:54: in setUp
self.normal_user = self.create_user(id=1)
[1m[31msrc/sentry/testutils/fixtures.py[0m:308: in create_user
return Factories.create_user(*args, **kwargs)
[1m[31m/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py[0m:85: in inner
return func(*args, **kwds)
[1m[31msrc/sentry/testutils/factories.py[0m:1086: in create_user
assert UserEmail.objects.filter(user=user, email=email).update(is_verified=True)
[1m[31mE AssertionError: assert 0[0m
[1m[31mE + where 0 = <bound method BaseQuerySet.update of <BaseQuerySet []>>(is_verified=True)[0m
[1m[31mE + where <bound method BaseQuerySet.update of <BaseQuerySet []>> = <BaseQuerySet []>.update[0m
[1m[31mE + where <BaseQuerySet []> = <bound method QuerySet.filter of <sentry.db.models.manager.base.UserEmailManager object at 0x7f5397512cf0>>(user=<User at 0x7f537c6fc3b0: id=1>, email='4a99d970fdc54c0ab4ccc8e2b98f740d@example.com')[0m
[1m[31mE + where <bound method QuerySet.filter of <sentry.db.models.manager.base.UserEmailManager object at 0x7f5397512cf0>> = <sentry.db.models.manager.base.UserEmailManager object at 0x7f5397512cf0>.filter[0m
[1m[31mE + where <sentry.db.models.manager.base.UserEmailManager object at 0x7f5397512cf0> = UserEmail.objects[0m
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with tests/sentry/api/test_permissions.py::IsAuthenticatedPermissionsTest::test_has_object_permission and the failing setup in src/sentry/testutils/factories.py:create_user. Run the named test, then trace why the UserEmail query is empty when the user is created. Done means the test passes reliably without the intermittent assertion failure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend, testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100