Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
milvus
milvus
提交
1cabaa16
M
milvus
项目概览
milvus
/
milvus
11 个月 前同步成功
通知
261
Star
22476
Fork
2472
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
milvus
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
1cabaa16
编写于
5月 18, 2022
作者:
Z
zhuwenxing
提交者:
GitHub
5月 18, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[skip e2e]Update multi replicas chaos test (#17084)
Signed-off-by:
N
zhuwenxing
<
wenxing.zhu@zilliz.com
>
上级
95bf9179
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
11 addition
and
5 deletion
+11
-5
tests/python_client/chaos/test_chaos_multi_replicas.py
tests/python_client/chaos/test_chaos_multi_replicas.py
+11
-5
未找到文件。
tests/python_client/chaos/test_chaos_multi_replicas.py
浏览文件 @
1cabaa16
...
...
@@ -5,6 +5,7 @@ import pytest
import
os
import
time
import
json
import
random
from
time
import
sleep
from
pymilvus
import
connections
...
...
@@ -130,7 +131,7 @@ class TestChaos(TestChaosBase):
@
pytest
.
mark
.
tags
(
CaseLabel
.
L3
)
@
pytest
.
mark
.
parametrize
(
"is_streaming"
,
[
False
])
# [False, True]
@
pytest
.
mark
.
parametrize
(
"failed_group_scope"
,
[
"one"
])
# ["one", "all"]
@
pytest
.
mark
.
parametrize
(
"failed_group_scope"
,
[
"one"
])
# ["one", "
except_one" "
all"]
@
pytest
.
mark
.
parametrize
(
"failed_node_type"
,
[
"shard_leader"
])
# ["non_shard_leader", "shard_leader"]
@
pytest
.
mark
.
parametrize
(
"chaos_type"
,
[
"pod-failure"
])
# ["pod-failure", "pod-kill"]
def
test_multi_replicas_with_only_one_group_available
(
self
,
chaos_type
,
failed_node_type
,
failed_group_scope
,
is_streaming
):
...
...
@@ -158,7 +159,9 @@ class TestChaos(TestChaosBase):
target_group
=
[]
group_list
=
sorted
(
group_list
,
key
=
lambda
x
:
-
len
(
x
))
if
failed_group_scope
==
"one"
:
target_group
=
group_list
[:
1
]
target_group
=
random
.
sample
(
group_list
,
1
)
if
failed_group_scope
==
"except_one"
:
target_group
=
random
.
sample
(
group_list
,
len
(
group_list
)
-
1
)
if
failed_group_scope
==
"all"
:
target_group
=
group_list
[:]
for
g
in
target_group
:
...
...
@@ -170,6 +173,7 @@ class TestChaos(TestChaosBase):
for
target_node
in
target_nodes
:
pod
=
querynode_id_pod_pair
[
target_node
]
target_pod_list
.
append
(
pod
)
log
.
info
(
f
"target_pod_list:
{
target_pod_list
}
"
)
chaos_config
=
cc
.
gen_experiment_config
(
f
"chaos/chaos_objects/template/
{
chaos_type
}
-by-pod-list.yaml"
)
chaos_config
[
'metadata'
][
'name'
]
=
f
"test-multi-replicase-
{
int
(
time
.
time
())
}
"
meta_name
=
chaos_config
.
get
(
'metadata'
,
None
).
get
(
'name'
,
None
)
...
...
@@ -191,6 +195,7 @@ class TestChaos(TestChaosBase):
group
=
constants
.
CHAOS_GROUP
,
version
=
constants
.
CHAOS_VERSION
,
namespace
=
constants
.
CHAOS_NAMESPACE
)
chaos_res
.
create
(
chaos_config
)
log
.
info
(
"chaos injected"
)
sleep
(
constants
.
WAIT_PER_OP
*
2
)
...
...
@@ -227,10 +232,11 @@ class TestChaos(TestChaosBase):
sleep
(
2
)
# wait all pods ready
log
.
info
(
f
"wait for pods in namespace
{
constants
.
CHAOS_NAMESPACE
}
with label app.kubernetes.io/instance=
{
release_name
}
"
)
wait_pods_ready
(
constants
.
CHAOS_NAMESPACE
,
f
"app.kubernetes.io/instance=
{
release_name
}
"
)
ready_1
=
wait_pods_ready
(
constants
.
CHAOS_NAMESPACE
,
f
"app.kubernetes.io/instance=
{
release_name
}
"
)
log
.
info
(
f
"wait for pods in namespace
{
constants
.
CHAOS_NAMESPACE
}
with label release=
{
release_name
}
"
)
wait_pods_ready
(
constants
.
CHAOS_NAMESPACE
,
f
"release=
{
release_name
}
"
)
log
.
info
(
"all pods are ready"
)
ready_2
=
wait_pods_ready
(
constants
.
CHAOS_NAMESPACE
,
f
"release=
{
release_name
}
"
)
if
ready_1
and
ready_2
:
log
.
info
(
"all pods are ready"
)
# reconnect if needed
sleep
(
constants
.
WAIT_PER_OP
*
2
)
# cc.reconnect(connections, alias='default')
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录