-
Notifications
You must be signed in to change notification settings - Fork 6.5k
[core] Rename GcsFunctionManager
and use fake in test
#53973
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[core] Rename GcsFunctionManager
and use fake in test
#53973
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR renames the GcsFunctionManager
class to GCSFunctionManager
everywhere and updates tests to use FakeInternalKVInterface
instead of mocks for function manager behavior verification.
- Rename
GcsFunctionManager
→GCSFunctionManager
across headers, sources, and tests - Swap out
MockInternalKVInterface
forFakeInternalKVInterface
in function manager tests - Implement
Del
,Exists
, andKeys
inFakeInternalKVInterface
to support fake-based tests
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
src/ray/gcs/gcs_server/test/gcs_job_manager_test.cc | Instantiate GCSFunctionManager instead of GcsFunctionManager |
src/ray/gcs/gcs_server/test/gcs_function_manager_test.cc | Rename fixture, use FakeInternalKVInterface , add HasKey helper |
src/ray/gcs/gcs_server/test/gcs_autoscaler_state_manager_test.cc | Update constructor to use GCSFunctionManager |
src/ray/gcs/gcs_server/test/gcs_actor_manager_test.cc | Instantiate GCSFunctionManager |
src/ray/gcs/gcs_server/test/export_api/gcs_job_manager_export_event_test.cc | Use GCSFunctionManager |
src/ray/gcs/gcs_server/test/export_api/gcs_actor_manager_export_event_test.cc | Switch parameter to GCSFunctionManager |
src/ray/gcs/gcs_server/gcs_server.h | Rename member to std::unique_ptr<GCSFunctionManager> |
src/ray/gcs/gcs_server/gcs_server.cc | Call std::make_unique<GCSFunctionManager> in InitFunctionManager |
src/ray/gcs/gcs_server/gcs_job_manager.h | Change constructor and member reference to GCSFunctionManager |
src/ray/gcs/gcs_server/gcs_function_manager.h | Rename class to GCSFunctionManager |
src/ray/gcs/gcs_server/gcs_actor_manager.h | Update constructor signature and member to GCSFunctionManager |
src/ray/gcs/gcs_server/gcs_actor_manager.cc | Adjust constructor parameter alignment for GCSFunctionManager |
src/mock/ray/gcs/gcs_server/gcs_kv_manager.h | Add real Del , Exists , Keys methods in FakeInternalKVInterface |
src/mock/ray/gcs/gcs_server/gcs_actor_manager.h | Update MockGcsActorManager to accept GCSFunctionManager |
Comments suppressed due to low confidence (3)
src/mock/ray/gcs/gcs_server/gcs_kv_manager.h:67
- The comment mentions support for
MultiGet
, but no implementation is provided in this class. Either implementMultiGet
or update the documentation to accurately reflect supported methods.
// Supports all operations: Get, MultiGet, Put, Del, Exists, Keys.
src/ray/gcs/gcs_server/gcs_actor_manager.h:346
- The indentation of this parameter is inconsistent with the surrounding parameter list. Align it with the other constructor parameters for better readability.
GCSFunctionManager &function_manager,
src/ray/gcs/gcs_server/gcs_actor_manager.cc:341
- This constructor parameter is indented unevenly compared to the other parameters. Adjust spacing so the parameter list aligns uniformly.
GCSFunctionManager &function_manager,
// Helper method to check if a key exists in the fake KV store | ||
bool HasKey(const std::string &ns, const std::string &key) { | ||
std::string full_key = ns + key; | ||
return kv->kv_store_.find(full_key) != kv->kv_store_.end(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The HasKey
helper inspects kv_store_
directly, coupling the test to an internal detail. Consider using the public Exists
or Keys
API to verify key presence, which keeps the test decoupled from the fake's internal representation.
return kv->kv_store_.find(full_key) != kv->kv_store_.end(); | |
return kv->Exists(full_key); |
Copilot uses AI. Check for mistakes.
af6e80b
to
a77eb4f
Compare
Signed-off-by: Sagar Sumit <sagarsumit09@gmail.com>
a77eb4f
to
97d94f1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯
…53973) Followup to ray-project#53951 (review) - Rename `GcsFunctionManager` to `GCSFunctionManager` - Use fakes instead of mocks in `gcs_function_manager_test.cc` Signed-off-by: Sagar Sumit <sagarsumit09@gmail.com>
Why are these changes needed?
Followup to #53951 (review)
GcsFunctionManager
toGCSFunctionManager
gcs_function_manager_test.cc