Skip to content

Commit

Permalink
tests: fix flakiness in connection cleanup test (#487)
Browse files Browse the repository at this point in the history
  • Loading branch information
plamut committed Sep 2, 2021
1 parent ee1d7b0 commit 4f88810
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/system.py
Expand Up @@ -446,7 +446,11 @@ def test_subscriber_not_leaking_open_sockets(
assert len(response.received_messages) == 3

conn_count_end = len(current_process.connections())
assert conn_count_end == conn_count_start

# To avoid flakiness, use <= in the assertion, since on rare occasions additional
# sockets are closed, causing the == assertion to fail.
# https://github.com/googleapis/python-pubsub/issues/483#issuecomment-910122086
assert conn_count_end <= conn_count_start


def test_synchronous_pull_no_deadline_error_if_no_messages(
Expand Down

0 comments on commit 4f88810

Please sign in to comment.