Skip to content

Commit

Permalink
test: fix flaky test for blocking pull shutdown (#378)
Browse files Browse the repository at this point in the history
If a test is run in a suite with other system tests, the messages
are not always published in batch sizes as desired, which can
affect how ACKs are handled on the backend (the server requires
all messages published in a single batch to be ACK-ed in order
to accept the ACKs).

If a publisher client instance is shared between the tests, the
batching can apparently be affected, thus we create a new client
instance before each test.

Since these tests are slow system tests, the overhead should not
be significant.
  • Loading branch information
plamut authored Apr 15, 2021
1 parent b8352f9 commit 13a6686
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ def project():
yield default_project


@pytest.fixture(scope="module")
@pytest.fixture()
def publisher():
yield pubsub_v1.PublisherClient()


@pytest.fixture(scope="module")
@pytest.fixture()
def subscriber():
yield pubsub_v1.SubscriberClient()

Expand Down

0 comments on commit 13a6686

Please sign in to comment.