empiredan commented on code in PR #1453:
URL:
https://github.com/apache/incubator-pegasus/pull/1453#discussion_r1172640085
##########
src/client/replication_ddl_client.h:
##########
@@ -346,6 +356,22 @@ class replication_ddl_client
dsn::task_tracker _tracker;
uint32_t _max_wait_secs = 3600; // Wait at most 1 hour by default.
+#ifdef PEGASUS_UNIT_TEST
+ FRIEND_TEST(DDLClientTest, RetryEndMetaRequest);
+ void set_mock_errors(const std::vector<dsn::error_code> &mock_errors)
+ {
+ _mock_errors.assign(mock_errors.begin(), mock_errors.end());
+ }
+ dsn::error_code get_mock_error()
Review Comment:
OK, good idea. Actually I've tried to use macro `#ifdef` to introduce extra
member variables for `replication_ddl_client` which is dedicated to unit tests,
however many strange errors happened (for example, a `std::deque` typed member
variable was uninitialized and had a super large size()), and it also violated
[ODR](https://en.cppreference.com/w/cpp/language/definition).
Thus I decide to use `FAIL_POINT_INJECT_NOT_RETURN_F` instead.
--
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]