Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test: Add test for auto subscriptions with nonexistent appids #460

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions src/integration-tests/test_auto_subscriptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,61 @@ def test_auto_subscription_fanout_all_negative(self, cluster: Cluster):
assert len(self.consumer_bar.list(block=True)) == 0
assert len(self.consumer_baz.list(block=True)) == 0

@tweak.domain.subscriptions(
[
{
"appId": "nonexistent-appid",
"expression": {"version": "E_VERSION_1", "text": "x==1"},
}
]
)
def test_nonexistent_appid(self, cluster: Cluster):
"""
Configure an auto subscription for a fanout App that does not exist.
Make sure all apps continue to receive messages.
"""
proxies = cluster.proxy_cycle()

# 1: Setup producers and consumers

next(proxies)
proxy = next(proxies)

producer = proxy.create_client("producer")
assert (
producer.open(tc.URI_FANOUT_SC, flags=["write", "ack"], block=True)
== Client.e_SUCCESS
)

self.consumer = self._start_client(proxy, tc.URI_FANOUT_SC_FOO, "consumerFoo")

self.consumer_bar = self._start_client(
proxy, tc.URI_FANOUT_SC_BAR, "consumerBar"
)
self.consumer_baz = self._start_client(
proxy, tc.URI_FANOUT_SC_BAZ, "consumerBaz"
)

assert (
producer.post(
tc.URI_FANOUT_SC,
payload=["123"],
block=True,
wait_ack=True,
messageProperties=[{"name": "x", "value": "0", "type": "E_INT"}],
)
== Client.e_SUCCESS
)

self.leader = cluster.last_known_leader

self._verify(tc.DOMAIN_FANOUT_SC, 0)
self._verify_fanout(tc.DOMAIN_FANOUT_SC, [], ["foo", "bar", "baz"], 0)

assert len(self.consumer.list(block=True)) == 0
assert len(self.consumer_bar.list(block=True)) == 0
assert len(self.consumer_baz.list(block=True)) == 0

@tweak.domain.subscriptions(
[
{
Expand Down
Loading