Copilot commented on code in PR #3750:
URL: https://github.com/apache/brpc/pull/3750#discussion_r4585555260
##########
src/brpc/rdma/rdma_endpoint.cpp:
##########
@@ -1954,6 +1954,12 @@ void RdmaEndpoint::GlobalRelease() {
std::vector<RdmaEndpoint::PollerGroup> RdmaEndpoint::_poller_groups;
+#if defined(UNIT_TEST)
+// Inject poller creation failures without requiring an RDMA device.
+decltype(&bthread_start_background) g_start_rdma_poller_for_test =
+ bthread_start_background;
+#endif
Review Comment:
This hook is only defined when `UNIT_TEST` is set, but the Bazel unit-test
target links `//:brpc` without defining `UNIT_TEST` for either the `brpc`
library or the generated `brpc_*_unittest` targets (see `BUILD.bazel:598-635`
and `test/generate_unittests.bzl:20-33`). The new test still declares and
references `g_start_rdma_poller_for_test`, so the Bazel RDMA test will fail to
link with an undefined symbol (and the production-compiled endpoint would not
use the injection path). Please either propagate the test define to the brpc
sources/test target or provide the hook through a test-only linked
implementation.
--
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]