Skip to content

Commit

Permalink
Merge pull request #1661 from Scille/fix-flaky-test_delete_invitation…
Browse files Browse the repository at this point in the history
…_while_claimer_connected

Fix flaky beavior in test_delete_invitation_while_claimer_connected
  • Loading branch information
touilleMan authored Mar 17, 2021
2 parents cfbec62 + e73245c commit 78eb978
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Empty file added newsfragments/1661.empty.rst
Empty file.
9 changes: 6 additions & 3 deletions tests/backend/invite/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,14 +521,14 @@ async def test_delete_invitation_while_claimer_connected(
async with backend_invited_sock_factory(
backend,
organization_id=alice.organization_id,
invitation_type=InvitationType.USER,
invitation_type=invitation.TYPE,
token=invitation.token,
freeze_on_transport_error=False,
) as invited_sock:
async with backend_invited_sock_factory(
backend,
organization_id=alice.organization_id,
invitation_type=InvitationType.USER,
invitation_type=other_invitation.TYPE,
token=other_invitation.token,
freeze_on_transport_error=False,
) as other_invited_sock:
Expand All @@ -547,7 +547,10 @@ async def test_delete_invitation_while_claimer_connected(
# Claimer connection can take some time to be closed
while True:
rep = await invite_info(invited_sock)
assert rep == {"status": "already_deleted"}
# Invitation info are cached for the connection
# at handshake time, hence if the command won't take
# into account the fact the invitation has been deleted
assert rep["status"] == "ok"

# However other invitations shouldn't have been affected
rep = await invite_info(other_invited_sock)
Expand Down

0 comments on commit 78eb978

Please sign in to comment.