已合并
【UBSE】补充HA和CLI相关IT用例 #1468
【UBSE】补充HA和CLI相关IT用例 #1468
已合并
weaver创建于 5 天前
weaver
weaver
5 天前

当前PR是否有AI参与:

[x] 否

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

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

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

该PR关联的issue

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

希望检视人员了解:

likedislike
Pull Request已成功合入, 合并人@openeuler-ci-bot
(感谢 weaver 的贡献)
weaverweaver
5 天前 创建了 pull request,commit fea4936f
weaverweaver
5 天前 关联了issue:[Enhancement]: [UBSE] 补充0/1级 IT用例
atomgit-bot
atomgit-bot
5 天前 评论:

变更摘要

本 PR 为 UBSE 选举(HA)模块补充集成测试用例,围绕选举收敛、主节点心跳、候选节点约束与选举禁用等场景新增测试。主要包含:新增双节点主节点周期心跳校验用例、双节点均禁用选举(election.candidate=false + election.wait=false)保持 init 角色用例、四节点错峰启动(节点2先升主、其余节点后加入)用例,以及四节点候选节点列表(election.candidateNodes=3,4)约束用例;同时在测试框架中新增两个场景夹具(Tongsuan1dFourNodesCandidateNodesScenarioTongsuan1dTwoNodesElectionDisabledScenario)和对应的测试函数实现(election_cases.cpp/election_cases.h)。

主要改动

  • 新增四节点错峰启动用例:在 tongsuan_1d_four_nodes/all_tests.cpp 注册 ExistingMasterUniqueStandby 用例,实现 RunFourNodeExistingMasterUniqueStandbyTest,通过 KillNode/RestartNode 模拟错峰启动,验证仅剩节点2时其升主、其余节点同时恢复后集群收敛为唯一主(仍为节点2)+ 唯一备 + 2 agent,并从 CLI display cluster 视角再次确认。
  • 新增候选节点约束场景与用例:新增场景目录 tongsuan_1d_four_nodes_candidate_nodes,场景夹具 Tongsuan1dFourNodesCandidateNodesScenario 为四节点配置 election.candidateNodes=3,4;用例 CandidateNodesOnlyMaster 通过 RunFourNodeCandidateNodesOnlyMasterTest 验证非候选节点1、2 始终不升主,候选节点3、4 可先后升主并选出唯一备。
  • 新增双节点主节点周期心跳用例:在 tongsuan_1d_two_nodes/all_tests.cpp 注册 MasterPeriodicHeartbeat 用例,实现 RunTwoNodeMasterPeriodicHeartbeatTest,通过主节点日志 [ELECTION] ProcTimer MASTER send pkt id=<id> 校验心跳具备周期性(3 个周期内至少 3 次)且确实发往对端备节点。
  • 新增选举禁用场景与用例:新增场景目录 tongsuan_1d_two_nodes_election_disabled,场景夹具 Tongsuan1dTwoNodesElectionDisabledScenario 配置两节点 election.candidate=falseelection.wait=false;用例 ElectionBothDisabledKeepInit 通过 RunTwoNodeBothElectionDisabledTest 校验配置、等待选举超时后确认两节点均停留在 init 角色(日志正面信号)且无 Master/Standby/Agent 角色切换(日志反面信号)。
  • 扩展选举测试公共实现:在 election_cases.cpp/election_cases.h 新增公共判断函数 HasUniqueMasterAndStandby(判定运行节点集合是否收敛为唯一主+唯一备,可指定期望主节点),并声明/实现上述四个测试函数,供各场景用例调用。
likedislike
openeuler-ci-botopeneuler-ci-bot成员
5 天前 将hlinbo,shw030915,Gao_Victor,qmyyxtl,caowaterman设为审查人
atomgit-bot
atomgit-bot
5 天前 评论:

代码审查

✅ 未发现问题

likedislike
此处折叠了112条消息 查看更多
openeuler-ci-bot
openeuler-ci-bot成员
1 天前 评论:

Review Code Feedback

  • The label lgtm-hlinbo, approved was added to this pull request. It means that hlinbo reviewed the code changes. 👋
Tips
  • If this pull request is not merged while all conditions are met, comment /check-pr to try again. 😄
likedislike
yezifa1
yezifa1成员
1 天前 评论:

/lgtm
/approve

likedislike
openeuler-ci-botopeneuler-ci-bot成员
1 天前 添加了label:lgtm-yezifa
openeuler-ci-bot
openeuler-ci-bot成员
1 天前 评论:

Review Code Feedback

  • The label lgtm-yezifa was added to this pull request. It means that yezifa reviewed the code changes. 👋
Tips
  • If this pull request is not merged while all conditions are met, comment /check-pr to try again. 😄
likedislike
openeuler-ci-botopeneuler-ci-bot成员
1 天前 合入了pull request,合并节点 SHA:c62c5954a48fbf046e1928ad8c063d44d4dd9b43