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

Fix flaky test_concurrent_queries_restriction_by_query_kind #46887

Merged
merged 1 commit into from
Feb 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,30 @@
node_insert = cluster.add_instance(
"node_insert", main_configs=["configs/concurrent_insert_restriction.xml"]
)
node_select = cluster.add_instance(
"node_select", main_configs=["configs/concurrent_select_restriction.xml"]
node_select1 = cluster.add_instance(
"node_select1", main_configs=["configs/concurrent_select_restriction.xml"]
)

node_select2 = cluster.add_instance(
"node_select2", main_configs=["configs/concurrent_select_restriction.xml"]
)

node_select3 = cluster.add_instance(
"node_select3", main_configs=["configs/concurrent_select_restriction.xml"]
)


@pytest.fixture(scope="module")
def started_cluster():
try:
cluster.start()
node_select.query(
node_select1.query(
"create table test_concurrent_insert (x UInt64) ENGINE = MergeTree() order by tuple()"
)
node_select2.query(
"create table test_concurrent_insert (x UInt64) ENGINE = MergeTree() order by tuple()"
)
node_select3.query(
"create table test_concurrent_insert (x UInt64) ENGINE = MergeTree() order by tuple()"
)
node_insert.query(
Expand Down Expand Up @@ -79,7 +93,7 @@ def assert_all_queries_passed(query_resuts):

def test_select(started_cluster):
common_pattern(
node_select,
node_select1,
"select",
"select sleep(3)",
"insert into test_concurrent_insert values (0)",
Expand All @@ -89,7 +103,7 @@ def test_select(started_cluster):

# subquery is not counted
execute_with_background(
node_select,
node_select2,
"select sleep(3)",
"insert into test_concurrent_insert select sleep(3)",
2,
Expand All @@ -98,7 +112,7 @@ def test_select(started_cluster):

# intersect and except are counted
common_pattern(
node_select,
node_select3,
"select",
"select sleep(1) INTERSECT select sleep(1) EXCEPT select sleep(1)",
"insert into test_concurrent_insert values (0)",
Expand Down