Skip to content

Commit a3a969b

Browse files
committed
Add integration tests
Signed-off-by: Emelia Lei <[email protected]>
1 parent 8cdba6e commit a3a969b

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

Diff for: src/integration-tests/test_migrate_to_csl.py

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Copyright 2025 Bloomberg Finance L.P.
2+
# SPDX-License-Identifier: Apache-2.0
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
"""
17+
Testing migrating to CSL.
18+
"""
19+
import blazingmq.dev.it.testconstants as tc
20+
from blazingmq.dev.it.fixtures import ( # pylint: disable=unused-import
21+
Cluster,
22+
multi_node,
23+
)
24+
25+
26+
def test_assign_queue(multi_node: Cluster):
27+
"""
28+
This test is to make sure when a queue assignment happens,
29+
it goes thought the CSL path, not the non-CSL.
30+
"""
31+
proxies = multi_node.proxy_cycle()
32+
proxy = next(proxies)
33+
34+
leader = multi_node.last_known_leader
35+
members = multi_node.nodes(exclude=leader)
36+
37+
# find the two nodes which are not the known leader
38+
uri = tc.URI_PRIORITY_SC
39+
40+
producer = proxy.create_client("producer")
41+
producer.open(uri, flags=["write"], succeed=True)
42+
43+
timeout = 1
44+
45+
for member in members:
46+
assert member.outputs_regex(
47+
"(Applying cluster message with type = UPDATE).*(queueAssignmentAdvisory)",
48+
timeout,
49+
)
50+
assert member.outputs_regex(
51+
"(Committed advisory).*queueAssignmentAdvisory", timeout
52+
)
53+
assert not member.outputs_regex(
54+
"'QueueUnAssignmentAdvisory' will be applied to", timeout
55+
)

0 commit comments

Comments
 (0)