Skip to content

Commit 8be9c5e

Browse files
committed
Assert on pubsub smoke test
Signed-off-by: Sergio Herrera <627709+seherv@users.noreply.github.com>
1 parent bf190a6 commit 8be9c5e

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

tests/integration/test_pubsub.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,20 @@ def test_published_messages_are_received_by_subscriber(client, wait_until):
5858
assert msg['message'] == 'hello world'
5959

6060

61-
def test_publish_event_succeeds(client):
62-
"""Verify publish_event does not raise on a valid topic."""
61+
def test_publish_event_succeeds(client, wait_until):
62+
run_id = uuid.uuid4().hex
6363
client.publish_event(
6464
pubsub_name=PUBSUB,
6565
topic_name=TOPIC,
66-
data=json.dumps({'run_id': uuid.uuid4().hex, 'id': 99, 'message': 'smoke test'}),
66+
data=json.dumps({'run_id': run_id, 'id': 99, 'message': 'smoke test'}),
6767
data_content_type='application/json',
6868
)
69+
70+
key = f'received-{run_id}-99'
71+
data = wait_until(
72+
lambda: client.get_state(store_name=STORE, key=key).data or None,
73+
timeout=10,
74+
)
75+
msg = json.loads(data)
76+
assert msg['id'] == 99
77+
assert msg['message'] == 'smoke test'

0 commit comments

Comments
 (0)