Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2dot5
ClickHouse
提交
0fcc06e8
C
ClickHouse
项目概览
2dot5
/
ClickHouse
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
ClickHouse
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
0fcc06e8
编写于
11月 28, 2020
作者:
A
alesapin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Merge pull request #17486 from ClickHouse/fix_more_flaky_tests
Fix more flaky integration tests (cherry picked from commit
1d179dac
)
上级
5193bf72
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
44 addition
and
29 deletion
+44
-29
docker/test/integration/runner/compose/docker_compose_kerberized_kafka.yml
...ration/runner/compose/docker_compose_kerberized_kafka.yml
+1
-1
docker/test/integration/runner/compose/docker_compose_mysql_golang_client.yml
...ion/runner/compose/docker_compose_mysql_golang_client.yml
+1
-1
docker/test/integration/runner/compose/docker_compose_mysql_java_client.yml
...ation/runner/compose/docker_compose_mysql_java_client.yml
+1
-1
docker/test/integration/runner/compose/docker_compose_mysql_js_client.yml
...gration/runner/compose/docker_compose_mysql_js_client.yml
+1
-1
docker/test/integration/runner/compose/docker_compose_mysql_php_client.yml
...ration/runner/compose/docker_compose_mysql_php_client.yml
+1
-1
docker/test/integration/runner/compose/docker_compose_postgesql_java_client.yml
...n/runner/compose/docker_compose_postgesql_java_client.yml
+1
-1
tests/integration/helpers/network.py
tests/integration/helpers/network.py
+13
-10
tests/integration/test_reload_zookeeper/test.py
tests/integration/test_reload_zookeeper/test.py
+2
-0
tests/integration/test_settings_constraints_distributed/test.py
...integration/test_settings_constraints_distributed/test.py
+23
-13
未找到文件。
docker/test/integration/runner/compose/docker_compose_kerberized_kafka.yml
浏览文件 @
0fcc06e8
...
...
@@ -50,7 +50,7 @@ services:
-
label:disable
kafka_kerberos
:
image
:
yandex/clickhouse-kerberos-kdc:${DOCKER_KERBEROS_KDC_TAG}
image
:
yandex/clickhouse-kerberos-kdc:${DOCKER_KERBEROS_KDC_TAG
:-latest
}
hostname
:
kafka_kerberos
volumes
:
-
${KERBERIZED_KAFKA_DIR}/secrets:/tmp/keytab
...
...
docker/test/integration/runner/compose/docker_compose_mysql_golang_client.yml
浏览文件 @
0fcc06e8
version
:
'
2.3'
services
:
golang1
:
image
:
yandex/clickhouse-mysql-golang-client:${DOCKER_MYSQL_GOLANG_CLIENT_TAG}
image
:
yandex/clickhouse-mysql-golang-client:${DOCKER_MYSQL_GOLANG_CLIENT_TAG
:-latest
}
# to keep container running
command
:
sleep infinity
docker/test/integration/runner/compose/docker_compose_mysql_java_client.yml
浏览文件 @
0fcc06e8
version
:
'
2.3'
services
:
java1
:
image
:
yandex/clickhouse-mysql-java-client:${DOCKER_MYSQL_JAVA_CLIENT_TAG}
image
:
yandex/clickhouse-mysql-java-client:${DOCKER_MYSQL_JAVA_CLIENT_TAG
:-latest
}
# to keep container running
command
:
sleep infinity
docker/test/integration/runner/compose/docker_compose_mysql_js_client.yml
浏览文件 @
0fcc06e8
version
:
'
2.3'
services
:
mysqljs1
:
image
:
yandex/clickhouse-mysql-js-client:${DOCKER_MYSQL_JS_CLIENT_TAG}
image
:
yandex/clickhouse-mysql-js-client:${DOCKER_MYSQL_JS_CLIENT_TAG
:-latest
}
# to keep container running
command
:
sleep infinity
docker/test/integration/runner/compose/docker_compose_mysql_php_client.yml
浏览文件 @
0fcc06e8
version
:
'
2.3'
services
:
php1
:
image
:
yandex/clickhouse-mysql-php-client:${DOCKER_MYSQL_PHP_CLIENT_TAG}
image
:
yandex/clickhouse-mysql-php-client:${DOCKER_MYSQL_PHP_CLIENT_TAG
:-latest
}
# to keep container running
command
:
sleep infinity
docker/test/integration/runner/compose/docker_compose_postgesql_java_client.yml
浏览文件 @
0fcc06e8
version
:
'
2.2'
services
:
java
:
image
:
yandex/clickhouse-postgresql-java-client:${DOCKER_POSTGRESQL_JAVA_CLIENT_TAG}
image
:
yandex/clickhouse-postgresql-java-client:${DOCKER_POSTGRESQL_JAVA_CLIENT_TAG
:-latest
}
# to keep container running
command
:
sleep infinity
tests/integration/helpers/network.py
浏览文件 @
0fcc06e8
...
...
@@ -179,16 +179,19 @@ class _NetworkManager:
except
docker
.
errors
.
NotFound
:
pass
# for some reason docker api may hang if image doesn't exist, so we download it
# before running
for
i
in
range
(
5
):
try
:
subprocess
.
check_call
(
"docker pull yandex/clickhouse-integration-helper"
,
shell
=
True
)
break
except
:
time
.
sleep
(
i
)
else
:
raise
Exception
(
"Cannot pull yandex/clickhouse-integration-helper image"
)
image
=
subprocess
.
check_output
(
"docker images -q yandex/clickhouse-integration-helper 2>/dev/null"
,
shell
=
True
)
if
not
image
.
strip
():
print
(
"No network image helper, will try download"
)
# for some reason docker api may hang if image doesn't exist, so we download it
# before running
for
i
in
range
(
5
):
try
:
subprocess
.
check_call
(
"docker pull yandex/clickhouse-integration-helper"
,
shell
=
True
)
break
except
:
time
.
sleep
(
i
)
else
:
raise
Exception
(
"Cannot pull yandex/clickhouse-integration-helper image"
)
self
.
_container
=
self
.
_docker_client
.
containers
.
run
(
'yandex/clickhouse-integration-helper'
,
auto_remove
=
True
,
...
...
tests/integration/test_reload_zookeeper/test.py
浏览文件 @
0fcc06e8
...
...
@@ -57,6 +57,7 @@ def test_reload_zookeeper(start_cluster):
</yandex >
"""
node
.
replace_config
(
"/etc/clickhouse-server/conf.d/zookeeper.xml"
,
new_config
)
node
.
query
(
"SYSTEM RELOAD CONFIG"
)
## config reloads, but can still work
assert_eq_with_retry
(
node
,
"SELECT COUNT() FROM test_table"
,
'1000'
,
retry_count
=
120
,
sleep_time
=
0.5
)
...
...
@@ -86,6 +87,7 @@ def test_reload_zookeeper(start_cluster):
</yandex>
"""
node
.
replace_config
(
"/etc/clickhouse-server/conf.d/zookeeper.xml"
,
new_config
)
node
.
query
(
"SYSTEM RELOAD CONFIG"
)
assert_eq_with_retry
(
node
,
"SELECT COUNT() FROM test_table"
,
'1000'
,
retry_count
=
120
,
sleep_time
=
0.5
)
tests/integration/test_settings_constraints_distributed/test.py
浏览文件 @
0fcc06e8
...
...
@@ -17,19 +17,14 @@ distributed = cluster.add_instance('distributed', main_configs=["configs/config.
def
started_cluster
():
try
:
cluster
.
start
()
for
node
in
[
node1
,
node2
]:
node
.
query
(
"CREATE TABLE sometable (date Date, id UInt32, value Int32) ENGINE = MergeTree() ORDER BY id;"
)
node
.
query
(
"INSERT INTO sometable VALUES (toDate('2010-01-10'), 1, 1)"
)
node
.
query
(
"CREATE USER shard"
)
node
.
query
(
"GRANT ALL ON *.* TO shard"
)
distributed
.
query
(
"CREATE TABLE proxy (date Date, id UInt32, value Int32) ENGINE = Distributed(test_cluster, default, sometable, toUInt64(date));"
)
distributed
.
query
(
"CREATE TABLE shard_settings (name String, value String) ENGINE = Distributed(test_cluster, system, settings);"
)
distributed
.
query
(
"CREATE ROLE admin"
)
distributed
.
query
(
"GRANT ALL ON *.* TO admin"
)
distributed
.
query
(
"CREATE TABLE shard_settings (name String, value String) ENGINE = Distributed(test_cluster, system, settings);"
)
yield
cluster
...
...
@@ -46,6 +41,14 @@ def restart_distributed():
def
test_select_clamps_settings
():
for
node
in
[
node1
,
node2
]:
node
.
query
(
"CREATE TABLE sometable_select (date Date, id UInt32, value Int32) ENGINE = MergeTree() ORDER BY id;"
)
node
.
query
(
"INSERT INTO sometable_select VALUES (toDate('2010-01-10'), 1, 1)"
)
distributed
.
query
(
"CREATE TABLE proxy_select (date Date, id UInt32, value Int32) ENGINE = Distributed(test_cluster, default, sometable_select, toUInt64(date));"
)
distributed
.
query
(
"CREATE USER normal DEFAULT ROLE admin SETTINGS max_memory_usage = 80000000"
)
distributed
.
query
(
"CREATE USER wasteful DEFAULT ROLE admin SETTINGS max_memory_usage = 2000000000"
)
distributed
.
query
(
"CREATE USER readonly DEFAULT ROLE admin SETTINGS readonly = 1"
)
...
...
@@ -53,7 +56,7 @@ def test_select_clamps_settings():
node2
.
query
(
"ALTER USER shard SETTINGS readonly = 1"
)
# Check that shards doesn't throw exceptions on constraints violation
query
=
"SELECT COUNT() FROM proxy"
query
=
"SELECT COUNT() FROM proxy
_select
"
assert
distributed
.
query
(
query
)
==
'2
\n
'
assert
distributed
.
query
(
query
,
user
=
'normal'
)
==
'2
\n
'
assert
distributed
.
query
(
query
,
user
=
'wasteful'
)
==
'2
\n
'
...
...
@@ -62,7 +65,7 @@ def test_select_clamps_settings():
assert
distributed
.
query
(
query
,
settings
=
{
"max_memory_usage"
:
40000000
,
"readonly"
:
2
})
==
'2
\n
'
assert
distributed
.
query
(
query
,
settings
=
{
"max_memory_usage"
:
3000000000
,
"readonly"
:
2
})
==
'2
\n
'
query
=
"SELECT COUNT() FROM remote('node{1,2}', 'default', 'sometable')"
query
=
"SELECT COUNT() FROM remote('node{1,2}', 'default', 'sometable
_select
')"
assert
distributed
.
query
(
query
)
==
'2
\n
'
assert
distributed
.
query
(
query
,
user
=
'normal'
)
==
'2
\n
'
assert
distributed
.
query
(
query
,
user
=
'wasteful'
)
==
'2
\n
'
...
...
@@ -103,10 +106,17 @@ def test_select_clamps_settings():
def
test_insert_clamps_settings
():
for
node
in
[
node1
,
node2
]:
node
.
query
(
"CREATE TABLE sometable_insert (date Date, id UInt32, value Int32) ENGINE = MergeTree() ORDER BY id;"
)
node
.
query
(
"INSERT INTO sometable_insert VALUES (toDate('2010-01-10'), 1, 1)"
)
distributed
.
query
(
"CREATE TABLE proxy_insert (date Date, id UInt32, value Int32) ENGINE = Distributed(test_cluster, default, sometable_insert, toUInt64(date));"
)
node1
.
query
(
"ALTER USER shard SETTINGS max_memory_usage = 50000000 MIN 11111111 MAX 99999999"
)
node2
.
query
(
"ALTER USER shard SETTINGS max_memory_usage = 50000000 MIN 11111111 MAX 99999999"
)
distributed
.
query
(
"INSERT INTO proxy VALUES (toDate('2020-02-20'), 2, 2)"
)
distributed
.
query
(
"INSERT INTO proxy VALUES (toDate('2020-02-21'), 2, 2)"
,
settings
=
{
"max_memory_usage"
:
5000000
})
distributed
.
query
(
"SYSTEM FLUSH DISTRIBUTED proxy"
)
assert_eq_with_retry
(
distributed
,
"SELECT COUNT() FROM proxy"
,
"4"
)
distributed
.
query
(
"INSERT INTO proxy
_insert
VALUES (toDate('2020-02-20'), 2, 2)"
)
distributed
.
query
(
"INSERT INTO proxy
_insert
VALUES (toDate('2020-02-21'), 2, 2)"
,
settings
=
{
"max_memory_usage"
:
5000000
})
distributed
.
query
(
"SYSTEM FLUSH DISTRIBUTED proxy
_insert
"
)
assert_eq_with_retry
(
distributed
,
"SELECT COUNT() FROM proxy
_insert
"
,
"4"
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录