getsentry / getsentry/sentry

Flaky test: tests/sentry/users/services/test_user_impl.py::DatabaseBackedUserService::test_get_or_create_user

Open
#108,925 1 comment 0 reactions 0 assignees View on GitHub

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/users/services/test_user_impl.py::DatabaseBackedUserService::test_get_or_create_user
Sentry sha: 4a8dadc9c184ad93a761561c5f57437a29cd3300
Run: https://github.com/getsentry/sentry/actions/runs/22283661245

tests/sentry/users/services/test_user_impl.py:33: in test_get_or_create_user
    assert user1.id == result.user.id
E   AssertionError: assert 3039 == 3040
E    +  where 3039 = <User at 0x7f7a7d2bf5c0: id=3039>.id
E    +  and   3040 = RpcUser(id=3040, pk=3040, name='', email='test@email.com', username='2', actor_id=None, display_name='test@email.com',...zenset(), permissions=frozenset(), avatar=None, emails=frozenset({'test@email.com'}), useremails=[], authenticators=[]).id
E    +    where RpcUser(id=3040, pk=3040, name='', email='test@email.com', username='2', actor_id=None, display_name='test@email.com',...zenset(), permissions=frozenset(), avatar=None, emails=frozenset({'test@email.com'}), useremails=[], authenticators=[]) = UserCreateResult(user=RpcUser(id=3040, pk=3040, name='', email='test@email.com', username='2', actor_id=None, display_...sions=frozenset(), avatar=None, emails=frozenset({'test@email.com'}), useremails=[], authenticators=[]), created=False).user

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with tests/sentry/users/services/test_user_impl.py::DatabaseBackedUserService::test_get_or_create_user and reproduce the failure from the linked Actions run or local test command. Trace why the returned RpcUser id differs from user1.id, then verify the test passes consistently without the 3039/3040 mismatch.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.