已开启
【UBSE】补充HA相关IT用例 #1460
【UBSE】补充HA相关IT用例 #1460
已开启
weaver创建于 7 天前
weaver
weaver
7 天前

当前PR是否有AI参与:

[x] 否

[ ] 是
__1. AI Agent 平台:
__2. AI 模型:
__3. Prompt上下文 :

参考:openEuler社区《生成式AI工具使用与开源贡献政策》

PR功能描述 / 为什么需要这个合入**:

该PR关联的issue

(格式为fixes #<issue号>, 或者resolves #<issue号>): fixes #

希望检视人员了解:

likedislike
合并受阻
weaverweaver
7 天前 创建了 pull request,commit f9f9e575
atomgit-bot
atomgit-bot
7 天前 评论:

变更摘要

本 PR 为 UBSE 集成测试(IT)补充高可用(HA)相关的选举用例,核心是围绕主备选举与故障恢复场景新增测试函数、测试场景与用例注册。测试函数新增于 election_cases.cpp 并在 election_cases.h 中声明,新增场景定义于 test/IT/scenarios/tongsuan_1d_four_nodes_staggered_start/test/IT/scenarios/tongsuan_1d_two_nodes_both_candidate_false/,并在 tongsuan_1d_four_nodestongsuan_1d_two_nodes 等既有场景中注册新用例;另有 4 个文件(it_cluster.cppit_cluster.hit_cluster_builder.cppit_cluster_builder.h)仅涉及文件末尾换行调整,无业务影响。

主要改动

  • 新增双节点主节点周期心跳用例 RunTwoNodeMasterPeriodicHeartbeatTest:在 tongsuan_1d_two_nodes 场景注册为 MasterPeriodicHeartbeat,收敛为 1 主+1 备后,通过主节点日志 [ELECTION] ProcTimer MASTER send pkt id=<id> 校验主节点周期性(≥3 次)向对端备节点发送心跳。
  • 新增双节点全候选关闭用例 RunTwoNodeBothCandidateFalseTest 及场景 Tongsuan1dTwoNodesBothCandidateFalseScenario:两节点均配置 election.candidate=false,等待超过选举超时(lostThreshold(3) × heartbeat.timeInterval)后,校验两节点保持 init(Initializer)角色、持续进入选举尝试(日志 local node state is ready, start to elect.),且日志中不出现 SwitchRole Group Master/Standby/Agent 的角色切换;场景通过 NoElection() 跳过启动期选举收敛等待并开启 DEBUG 日志。
  • 新增四节点错峰启动用例 RunFourNodeStaggeredStartTest 及场景 Tongsuan1dFourNodesStaggeredStartScenario:先收敛后 KillNode 停掉节点 1、3、4 仅留节点 2,节点 2 心跳超时升主,再 RestartNode 同时恢复节点 1、3、4,最终通过 CLI display cluster / display node 校验集群收敛为唯一 1 主+1 备+2 agent 且主节点保持为节点 2。
  • 新增四节点备节点重选用例 RunFourNodeStandbyReelectTest:在 tongsuan_1d_four_nodes 场景注册为 StandbyDownReelectNewStandby,kill 备节点后轮询主节点视角(QueryClusterInfo)验证主节点在存活 agent 中重选出新备、主角色不变,重启原备(以 agent 回归)后再次 kill 当前备并重选,全程校验主保持不变,覆盖主节点清除 standbyId_ 并重选备的源码路径。
  • 补充新用例的接口声明election_cases.h 新增 RunTwoNodeMasterPeriodicHeartbeatTestRunTwoNodeBothCandidateFalseTestRunFourNodeStaggeredStartTestRunFourNodeStandbyReelectTest 等函数声明,供各场景的 all_tests.cpp 调用。
likedislike
openeuler-ci-botopeneuler-ci-bot成员
7 天前 将hlinbo,shw030915,Gao_Victor,qmyyxtl,caowaterman设为审查人
atomgit-bot
atomgit-bot
7 天前 评论:

代码审查

✅ 未发现问题

likedislike
openeuler-ci-botopeneuler-ci-bot成员
7 天前 添加了label:sig/sig-UB-ServiceCore
openeuler-ci-bot
openeuler-ci-bot成员
7 天前 评论:

Welcome To openEuler Community

Hey @junjunl , thanks for your contribution to the community.

Bot Usage Manual

I'm the Bot here serving you. You can find the instructions on how to interact with me at Here . That means you can comment below every pull request or issue to trigger Bot Commands.

Contact Guide

If you have any questions, please contact the SIG: sig-UB-ServiceCore ,
and any of the maintainers: @Gao_Victor, @caowaterman, @hlinbo, @qmyyxtl, @shw030915 ,
and any of the committers: @HJLi96, @gongwang1, @hlb-source, @hlinbo, @meng_zhaohui, @wangwenlong7, @xuchenfengcleancode, @yezifa .

likedislike
openeuler-ci-botopeneuler-ci-bot成员
7 天前 添加了label:openeuler-cla/yes
openeuler-ci-botopeneuler-ci-bot成员
7 天前 添加了label:docs_ci_running
openeuler-ci-botopeneuler-ci-bot成员
7 天前 添加了label:ci_processing
openeuler-ci-bot
openeuler-ci-bot成员
7 天前 评论:

门禁正在运行, 您可以通过以下链接查看实时门禁检查结果.
若您对门禁结果含义不清晰或者遇到问题不知如何解决,可参考门禁指导手册
门禁入口及编码规范检查: multiarch/openeuler/trigger/ubs-engine/6807/console

likedislike
openeuler-ci-bot
openeuler-ci-bot成员
7 天前 评论:

✅ 跳过 docs ci 检查,没有需要检查的文档文件

likedislike
openeuler-ci-botopeneuler-ci-bot成员
7 天前 删除了label:docs_ci_running
此处折叠了5条事件消息 查看更多
openeuler-ci-botopeneuler-ci-bot成员
7 天前 添加了label:openeuler-cla/yes
openeuler-ci-bot
openeuler-ci-bot成员
7 天前 评论:

CLA Signature Pass

junjunl, thanks for your pull request. All authors of the commits have signed the CLA. 👍

likedislike
openeuler-ci-botopeneuler-ci-bot成员
7 天前 删除了label:docs_ci_successful
openeuler-ci-botopeneuler-ci-bot成员
7 天前 添加了label:docs_ci_running
openeuler-ci-bot
openeuler-ci-bot成员
7 天前 评论:

门禁正在运行, 您可以通过以下链接查看实时门禁检查结果.
若您对门禁结果含义不清晰或者遇到问题不知如何解决,可参考门禁指导手册
门禁入口及编码规范检查: multiarch/openeuler/trigger/ubs-engine/6808/console

likedislike
openeuler-ci-bot
openeuler-ci-bot成员
7 天前 评论:

✅ 跳过 docs ci 检查,没有需要检查的文档文件

likedislike
openeuler-ci-botopeneuler-ci-bot成员
7 天前 删除了label:docs_ci_running
openeuler-ci-botopeneuler-ci-bot成员
7 天前 添加了label:docs_ci_successful
openeuler-ci-botopeneuler-ci-bot成员
7 天前 删除了label:ci_processing
openeuler-ci-bot
openeuler-ci-bot成员
7 天前 评论:
Check Name Build Result 详情 Build Details
check_sca WARNING • SCA检查发现未确认的开源组件问题,请查看报告: https://www.openlibing.com/apps/personalScandTaskInfor/person/63b239ab-3faa-4d27-8a22-8ec05a091826?projectId=300024&codeHostingPlatformFlag=gitcode #6807
check_code SUCCESS
check_package_license WARNING • 仓库copyright检查未通过: ubs-engine/test/IT/CMakeLists.txt、ubs-engine/test/IT/scenarios/tongsuan_1d_four_nodes_staggered_start/CMakeLists.txt、ubs-engine/test/IT/scenarios/tongsuan_1d_two_nodes_both_candidate_false/CMakeLists.txt文件缺失Copyright声明, Copyright path:缺少项目级Copyright声明文件
x86_64 check_build SUCCESS #6797
aarch64 check_build SUCCESS #6805
pre-commit check_build SUCCESS #6145
DT check_build SUCCESS #6095
check_issue_associate check_build SUCCESS #9547
likedislike
openeuler-ci-botopeneuler-ci-bot成员
7 天前 添加了label:ci_successful
openeuler-ci-bot
openeuler-ci-bot成员
7 天前 评论:
likedislike
openeuler-ci-bot
openeuler-ci-bot成员
7 天前 评论:
Check Name Build Result 详情 Build Details
check_sca WARNING • SCA检查发现未确认的开源组件问题,请查看报告: https://www.openlibing.com/apps/personalScandTaskInfor/person/06d0ec42-990f-452b-9e28-ed967a9c355d?projectId=300024&codeHostingPlatformFlag=gitcode #6808
check_code SUCCESS
check_package_license WARNING • 仓库copyright检查未通过: ubs-engine/test/IT/CMakeLists.txt、ubs-engine/test/IT/scenarios/tongsuan_1d_four_nodes_staggered_start/CMakeLists.txt、ubs-engine/test/IT/scenarios/tongsuan_1d_two_nodes_both_candidate_false/CMakeLists.txt文件缺失Copyright声明, Copyright path:缺少项目级Copyright声明文件
x86_64 check_build SUCCESS #6798
aarch64 check_build SUCCESS #6806
pre-commit check_build SUCCESS #6146
DT check_build SUCCESS #6096
check_issue_associate check_build SUCCESS #9548
likedislike
openeuler-ci-bot
openeuler-ci-bot成员
7 天前 评论:
likedislike