gavinchou commented on code in PR #51591:
URL: https://github.com/apache/doris/pull/51591#discussion_r2139040344


##########
cloud/src/recycler/checker.cpp:
##########
@@ -437,13 +439,17 @@ int InstanceChecker::init_storage_vault_accessors(const 
InstanceInfoPB& instance
         }
 
         if (vault.has_hdfs_info()) {
+#ifdef UNIT_TEST
+            auto accessor = std::make_shared<MockAccessor>();

Review Comment:
   use injection instead of MACRO 
   
   e.g.
   ```
   auto create_hdfs_accessor(...) {
       TEST_SYNC_POINT_RETURN_WITH_VALUE("create_hdfs_accessor for UT", ...);
       return std::make_shared<HdfsAccessor>(vault.hdfs_info());
   }
   
   
   
   ...
   if (vault.has_hdfs_info()) {
       ....
       auto accessor create_hdfs_accessor(vault.hdfs_info());
   ....
   ...
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to