Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
corps committed Oct 12, 2023
1 parent c3807cf commit 767cf66
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/sentry/models/test_outbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from sentry.models.organizationmemberteamreplica import OrganizationMemberTeamReplica
from sentry.models.outbox import (
ControlOutbox,
OutboxBase,
OutboxCategory,
OutboxFlushError,
OutboxScope,
Expand Down Expand Up @@ -392,7 +393,9 @@ def test_drain_shard_flush_all__concurrent_processing__cooperation(
assert mock_process_region_outbox.call_count == 2

def test_holding_lock_too_long(self):
outbox = OrganizationMember(id=1, organization_id=3, user_id=1).outbox_for_update()
outbox: OutboxBase = OrganizationMember(
id=1, organization_id=3, user_id=1
).outbox_for_update()
with outbox_context(flush=False):
outbox.save()

Expand All @@ -404,7 +407,7 @@ def test_inside_locked():
with outbox.process_shard(RegionOutbox(id=0)) as shard_outbox:
assert shard_outbox is None
with pytest.raises(OutboxFlushError):
with outbox.process_shard(RegionOutbox(id=outbox.id + 1)) as outbox:
with outbox.process_shard(RegionOutbox(id=outbox.id + 1)):
pass

thread = threading.Thread(target=wrap_with_connection_closure(test_inside_locked))
Expand Down

0 comments on commit 767cf66

Please sign in to comment.