Skip to content

Commit 3c13d50

Browse files
committed
Remove flaky PubSub snapshots system test
The PubSub backend does not give any guarantees about when a message will be re-delivered after seeking back to a snapshot, it will only be delivered "eventually". That causes flakiness in the snapshots test. Since the test cannot wait for an indefinite amount of time, this commit removes it in order to not randomly break the CI builds.
1 parent 3545b17 commit 3c13d50

File tree

1 file changed

+0
-42
lines changed

1 file changed

+0
-42
lines changed

pubsub/tests/system.py

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -297,48 +297,6 @@ def test_listing_topic_subscriptions(publisher, subscriber, project, cleanup):
297297
assert subscriptions == {subscription_paths[0], subscription_paths[2]}
298298

299299

300-
def test_using_snapshots(
301-
publisher, subscriber, project, topic_path, subscription_path, cleanup
302-
):
303-
snapshot_path = subscriber.snapshot_path(project, "my-snapshot")
304-
305-
# Make sure the topic, subscription, and snapshot get deleted.
306-
cleanup.append((publisher.delete_topic, topic_path))
307-
cleanup.append((subscriber.delete_subscription, subscription_path))
308-
cleanup.append((subscriber.delete_snapshot, snapshot_path))
309-
310-
# publish a message to a topic, pull and acknowledge it
311-
publisher.create_topic(topic_path)
312-
subscriber.create_subscription(subscription_path, topic_path)
313-
314-
publisher.publish(topic_path, b"Message 1")
315-
response = subscriber.pull(subscription_path, max_messages=100)
316-
assert len(response.received_messages) == 1
317-
msg = response.received_messages[0]
318-
subscriber.acknowledge(subscription_path, [msg.ack_id])
319-
320-
# repeat the same *after* creating a snapshot
321-
subscriber.create_snapshot(snapshot_path, subscription_path)
322-
323-
publisher.publish(topic_path, b"Message 2")
324-
response = subscriber.pull(subscription_path, max_messages=100)
325-
msg = response.received_messages[0]
326-
subscriber.acknowledge(subscription_path, [msg.ack_id])
327-
328-
# pulling again, there should be no messages received
329-
response = subscriber.pull(
330-
subscription_path, max_messages=100, return_immediately=True
331-
)
332-
assert len(response.received_messages) == 0
333-
334-
# after seeking to the snapshot, the second message should be received again
335-
subscriber.seek(subscription_path, snapshot=snapshot_path)
336-
response = subscriber.pull(subscription_path, max_messages=100)
337-
assert len(response.received_messages) == 1
338-
msg = response.received_messages[0]
339-
assert msg.message.data == b"Message 2"
340-
341-
342300
def test_managing_topic_iam_policy(publisher, topic_path, cleanup):
343301
cleanup.append((publisher.delete_topic, topic_path))
344302

0 commit comments

Comments
 (0)