Fix test_cluster_all_replicas

This commit is contained in:
Alexey Milovidov 2024-08-12 07:01:52 +02:00
parent 0b1887eb65
commit 5acf9f6f81

View File

@ -21,14 +21,14 @@ def start_cluster():
def test_cluster(start_cluster):
assert (
node1.query(
"SELECT hostName() FROM clusterAllReplicas('one_shard_two_nodes', system.one)"
"SELECT hostName() FROM clusterAllReplicas('one_shard_two_nodes', system.one) ORDER BY ALL"
)
== "node1\nnode2\n"
)
assert set(
node1.query(
"""SELECT hostName(), * FROM clusterAllReplicas("one_shard_two_nodes", system.one) ORDER BY dummy"""
"""SELECT hostName(), * FROM clusterAllReplicas("one_shard_two_nodes", system.one) ORDER BY ALL"""
).splitlines()
) == {"node1\t0", "node2\t0"}
@ -48,7 +48,7 @@ def test_global_in(start_cluster):
assert set(
node1.query(
"""SELECT hostName(), * FROM clusterAllReplicas("one_shard_two_nodes", system.one) where dummy GLOBAL IN u"""
"""SELECT hostName(), * FROM clusterAllReplicas("one_shard_two_nodes", system.one) where dummy GLOBAL IN u ORDER BY ALL"""
).splitlines()
) == {"node1\t0", "node2\t0"}
@ -63,7 +63,7 @@ def test_global_in(start_cluster):
def test_skip_unavailable_replica(start_cluster, cluster):
assert (
node1.query(
f"SELECT hostName() FROM clusterAllReplicas('{cluster}', system.one) settings skip_unavailable_shards=1"
f"SELECT hostName() FROM clusterAllReplicas('{cluster}', system.one) ORDER BY ALL settings skip_unavailable_shards=1"
)
== "node1\nnode2\n"
)
@ -81,5 +81,5 @@ def test_error_on_unavailable_replica(start_cluster, cluster):
# so when skip_unavailable_shards=0 - any unavailable replica should lead to an error
with pytest.raises(QueryRuntimeException):
node1.query(
f"SELECT hostName() FROM clusterAllReplicas('{cluster}', system.one) settings skip_unavailable_shards=0"
f"SELECT hostName() FROM clusterAllReplicas('{cluster}', system.one) ORDER BY ALL settings skip_unavailable_shards=0"
)