Skip to content

[ISSUE #7617]🧪Add snapshot and append coverage for ClusterAddrTable#8104

Merged
mxsm merged 1 commit into
mxsm:mainfrom
WaterWhisperer:test-7617
Jul 7, 2026
Merged

[ISSUE #7617]🧪Add snapshot and append coverage for ClusterAddrTable#8104
mxsm merged 1 commit into
mxsm:mainfrom
WaterWhisperer:test-7617

Conversation

@WaterWhisperer

@WaterWhisperer WaterWhisperer commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Which Issue(s) This PR Fixes(Closes)

Brief Description

How Did You Test This Change?

Summary by CodeRabbit

  • Tests
    • Added coverage for removing an unknown cluster, confirming it returns false.
    • Added tests to ensure snapshot results stay stable when the table changes.
    • Added tests verifying cluster and broker names are appended to existing topic lists without removing current entries.

@rocketmq-rust-bot

Copy link
Copy Markdown
Collaborator

🔊@WaterWhisperer 🚀Thanks for your contribution🎉!

💡CodeRabbit(AI) will review your code first🔥!

Note

🚨The code review suggestions from CodeRabbit are to be used as a reference only, and the PR submitter can decide whether to make changes based on their own judgment. Ultimately, the project management personnel will conduct the final code review💥.

@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: da171cdc-3cad-49b4-b14d-15c401645fb9

📥 Commits

Reviewing files that changed from the base of the PR and between 521a502 and e129ed0.

📒 Files selected for processing (1)
  • rocketmq-namesrv/src/route/tables/cluster_table.rs

Walkthrough

This PR adds unit test coverage to cluster_table.rs: an additional assertion in test_remove_cluster for unknown clusters, and two new tests verifying snapshot() returns owned, stable public broker names and append_cluster_and_broker_names appends entries without removing existing topic list elements.

Changes

Cluster table test coverage

Layer / File(s) Summary
Extend remove_cluster and add snapshot/append tests
rocketmq-namesrv/src/route/tables/cluster_table.rs
Adds an assertion that removing an unknown cluster returns false, plus new tests for snapshot ownership/stability and append_cluster_and_broker_names appending behavior.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Suggested reviewers: rocketmq-rust-bot, TeslaRustor, mxsm

Poem

A rabbit hops through cluster names so bright,
Testing snapshots frozen, owned just right. 🐇
Append a broker, append a cluster too,
Unknown removals return false, it's true!
Hop, hop, hooray — the tests all pass anew! 🥕

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR covers snapshot, append, and remove_cluster cases, but it doesn't show the required cleanup_empty_clusters behavior for non-empty clusters. Add or update a test proving cleanup_empty_clusters leaves non-empty clusters unchanged, then rerun cargo test -p rocketmq-namesrv cluster_table.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and matches the main change: added snapshot and append coverage for ClusterAddrTable.
Out of Scope Changes check ✅ Passed Changes stay within cluster_table.rs and add only related unit-test coverage.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@mxsm mxsm merged commit 87a58e0 into mxsm:main Jul 7, 2026
11 of 28 checks passed
@WaterWhisperer WaterWhisperer deleted the test-7617 branch July 7, 2026 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Test🧪] Add snapshot and append coverage for ClusterAddrTable

4 participants