Copilot commented on code in PR #3326:
URL: https://github.com/apache/brpc/pull/3326#discussion_r3341255428


##########
.github/workflows/ci-linux.yml:
##########
@@ -237,7 +247,6 @@ jobs:
         grep -qE "bazel_dep\(name = ['\"]protobuf['\"], version = 
['\"]${TEST_PROTOBUF_VERSION}['\"]" MODULE.bazel \
           || { echo "ERROR: failed to override protobuf version in 
MODULE.bazel to ${TEST_PROTOBUF_VERSION}"; exit 1; }
     - run: | 
-        bazel test --action_env=CC=clang  \
+        bazel test --action_env=CC=clang --config=rdma \
                    --define with_babylon_counter=true \
-                   --define with_babylon_counter=true \
-                   //test:brpc_unittests
+                   //test/... --test_arg=--gtest_filter=-RdmaRpcTest.*

Review Comment:
   The gtest filter `-RdmaRpcTest.*` is unlikely to actually exclude the 
parameterized `RdmaRpcTest` tests. With 
`INSTANTIATE_TEST_SUITE_P(HandshakeVersion, RdmaRpcTest, ...)`, the full gtest 
test names are of the form `HandshakeVersion/RdmaRpcTest.<test_name>/v2` (and 
`/v3`), so a pattern that requires the name to start with `RdmaRpcTest.` will 
not match and the tests will still run. To exclude them, use a pattern like 
`-*RdmaRpcTest*` or `-HandshakeVersion/RdmaRpcTest.*`.



##########
test/brpc_rdma_unittest.cpp:
##########
@@ -1845,13 +2383,14 @@ TEST_F(RdmaTest, rdma_use_parallel_channel) {
     Channel subchans[NCHANS];
     ParallelChannel channel;
     ChannelOptions opts;
-    opts.use_rdma = true;
+    opts.socket_mode = SOCKET_MODE_RDMA;
     for (size_t i = 0; i < NCHANS; ++i) {
         ASSERT_EQ(0, subchans[i].Init(_naming_url.c_str(), "rR", &opts));
         ASSERT_EQ(0, channel.AddChannel(
                     &subchans[i], DOESNT_OWN_CHANNEL,
                     NULL, NULL));
     }
+       ASSERT_EQ(0, channel.Init(NULL));

Review Comment:
   This line is indented with a literal tab character while every other line in 
this test file uses spaces. The mixed indentation will look misaligned in 
editors with non-default tab widths and is inconsistent with the surrounding 
style.



##########
src/brpc/rdma/rdma_handshake.cpp:
##########
@@ -0,0 +1,407 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#if BRPC_WITH_RDMA
+
+#include "brpc/rdma/rdma_handshake.h"
+
+#include <algorithm>            // std::min
+#include <cstring>
+#include <string>

Review Comment:
   `std::numeric_limits` (used here in `v3_wire::ValidRdmaHello`) requires 
`<limits>`, but this file does not include it directly. It currently compiles 
only because `<limits>` is transitively pulled in by other headers (e.g. via 
`butil/iobuf.h`), which is fragile. Please add an explicit `#include <limits>` 
to make the dependency self-contained.



-- 
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