mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 23:21:59 +00:00
Merge pull request #23903 from azat/fix-flaky-tests-21.6
Fix test_insert_into_distributed flaps
This commit is contained in:
commit
742434a0cd
@ -198,28 +198,34 @@ def test_inserts_single_replica_local_internal_replication(started_cluster):
|
||||
|
||||
|
||||
def test_inserts_single_replica_internal_replication(started_cluster):
|
||||
node1.query(
|
||||
"INSERT INTO distributed_one_replica_internal_replication VALUES ('2000-01-01', 1)",
|
||||
settings={
|
||||
"insert_distributed_sync": "1",
|
||||
"prefer_localhost_replica": "0",
|
||||
# to make the test more deterministic
|
||||
"load_balancing": "first_or_random",
|
||||
},
|
||||
)
|
||||
assert node2.query("SELECT count(*) FROM single_replicated").strip() == '1'
|
||||
|
||||
|
||||
def test_inserts_single_replica_no_internal_replication(started_cluster):
|
||||
with pytest.raises(QueryRuntimeException, match="Table default.single_replicated doesn't exist"):
|
||||
try:
|
||||
node1.query(
|
||||
"INSERT INTO distributed_one_replica_no_internal_replication VALUES ('2000-01-01', 1)",
|
||||
"INSERT INTO distributed_one_replica_internal_replication VALUES ('2000-01-01', 1)",
|
||||
settings={
|
||||
"insert_distributed_sync": "1",
|
||||
"prefer_localhost_replica": "0",
|
||||
# to make the test more deterministic
|
||||
"load_balancing": "first_or_random",
|
||||
},
|
||||
)
|
||||
assert node2.query("SELECT count(*) FROM single_replicated").strip() == '1'
|
||||
assert node2.query("SELECT count(*) FROM single_replicated").strip() == '1'
|
||||
finally:
|
||||
node2.query("TRUNCATE TABLE single_replicated")
|
||||
|
||||
|
||||
def test_inserts_single_replica_no_internal_replication(started_cluster):
|
||||
try:
|
||||
with pytest.raises(QueryRuntimeException, match="Table default.single_replicated doesn't exist"):
|
||||
node1.query(
|
||||
"INSERT INTO distributed_one_replica_no_internal_replication VALUES ('2000-01-01', 1)",
|
||||
settings={
|
||||
"insert_distributed_sync": "1",
|
||||
"prefer_localhost_replica": "0",
|
||||
},
|
||||
)
|
||||
assert node2.query("SELECT count(*) FROM single_replicated").strip() == '1'
|
||||
finally:
|
||||
node2.query("TRUNCATE TABLE single_replicated")
|
||||
|
||||
|
||||
def test_prefer_localhost_replica(started_cluster):
|
||||
|
Loading…
Reference in New Issue
Block a user