Skip to content

<fix>[testlib]: handle non-existent volume in getsnapinfos VFS hook#3480

Open
zstack-robot-1 wants to merge 1 commit into5.5.12from
sync/zstackio/fix/flaky-test-cleanup
Open

<fix>[testlib]: handle non-existent volume in getsnapinfos VFS hook#3480
zstack-robot-1 wants to merge 1 commit into5.5.12from
sync/zstackio/fix/flaky-test-cleanup

Conversation

@zstack-robot-1
Copy link
Collaborator

Summary

  • CephPrimaryStorageSpec.groovy 的 getsnapinfos VFS hook 在 volume 不存在时直接 assert 失败
  • 在 volume 迁移场景中,目标 PS 上尚未有该 volume,导致 SchedulerSnapShotWithVolumeMigrateCase 稳定性测试失败
  • 修复:当 volume 不存在时返回空 snapshot 列表,而非 assert 失败

Test plan

  • SchedulerSnapShotWithVolumeMigrateCase 稳定性测试不再因 VFS assert 失败
  • CI 验证通过

sync from gitlab !9340

Return empty snapshot list instead of asserting when volume
does not exist on destination PS. Fixes VFS assertion failure
during CephToCeph volume migration in stability tests.

Change-Id: I7d8e4f2a1b3c5d6e7f8a9b0c1d2e3f4a5b6c7d8e
@coderabbitai
Copy link

coderabbitai bot commented Mar 12, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: http://open.zstack.ai:20001/code-reviews/zstack-cloud.yaml (via .coderabbit.yaml)

Review profile: CHILL

Plan: Pro

Run ID: 4dd0eb50-3e10-48a0-9e26-96276c4bed6b

📥 Commits

Reviewing files that changed from the base of the PR and between 681a301 and 540ea3d.

📒 Files selected for processing (1)
  • testlib/src/main/java/org/zstack/testlib/CephPrimaryStorageSpec.groovy

演进总结

修改了 CephPrimaryStorageSpec 中 GET_VOLUME_SNAPINFOS_PATH 的处理逻辑,使其在目标卷路径不存在时返回空快照列表,而非触发断言失败。路径存在时保持原有行为。

变更详情

变更组群 / 文件 变更摘要
Ceph 主存储快照查询处理
testlib/src/main/java/org/zstack/testlib/CephPrimaryStorageSpec.groovy
调整 GET_VOLUME_SNAPINFOS_PATH 处理逻辑,将路径不存在时的断言改为返回空快照信息列表,优化错误处理方式。

预计代码审查工作量

🎯 2 (简单) | ⏱️ ~8 分钟

诗歌庆祝

🐰 聪慧的兔子修改路,
不再断言即破裂,
空列表优雅而温柔,
让快照查询更从容。
一行代码,四行智慧,
容错之心在其中。✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed 标题遵循要求的 [scope]: 格式,长度为67字符(不超过72字符),清晰描述了主要变更:在 getsnapinfos VFS hook 中处理不存在的卷。
Description check ✅ Passed 描述准确关联到变更内容,说明了问题场景(卷迁移)、原有行为(assert失败)和修复方案(返回空列表),与代码变更相符。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch sync/zstackio/fix/flaky-test-cleanup

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants