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


##########
test/brpc_rdma_unittest.cpp:
##########
@@ -1731,10 +1751,431 @@ rdma::RdmaHello MakeValidV3Hello() {
     return msg;
 }
 
+// A raw peer can reject v3 exactly as an old server would, without adding a
+// server-side version flag or requiring RDMA hardware.
+class RdmaHandshakeRetryTest : public RdmaTest {
+protected:
+    RdmaHandshakeRetryTest() : _started(false) {}
 
-TEST_F(RdmaTest, v3_client_hello_bytes_baseline) {
-    HandshakeVersionFlag _hsv(3);
+    void SetUp() override {
+        _listener.reset(butil::tcp_listen(butil::EndPoint(g_ep.ip, 0)));
+        ASSERT_GE(_listener, 0);
+        ASSERT_EQ(0, butil::get_local_side(_listener, &g_ep));
+    }
 
+    void TearDown() override {
+        if (_socket && !_socket->Failed()) {
+            _socket->SetFailed(ECANCELED, "Handshake test finished");
+        }
+        if (_started) {
+            bthread_id_join(_cntl.call_id());
+        }
+        RdmaTest::TearDown();
+    }
+
+    void StartRpc(int connect_timeout_ms = 2000) {
+        ChannelOptions options;
+        options.socket_mode = SOCKET_MODE_RDMA;
+        options.connection_type = CONNECTION_TYPE_SINGLE;
+        options.connect_timeout_ms = connect_timeout_ms;
+        options.timeout_ms = 5000;
+        options.max_retry = 0;
+        ASSERT_EQ(0, _channel.Init(g_ep, &options));
+        _req.set_message("handshake retry");
+        _started = true;
+        test::EchoService::Stub(&_channel).Echo(&_cntl, &_req, &_res, 
DoNothing());
+        ASSERT_EQ(0, Socket::Address(_cntl._single_server_id, &_socket));
+    }
+
+    int AcceptPeer() {
+        return ::AcceptPeer(_listener);

Review Comment:
   This qualification refers to the global namespace, but the helper 
`AcceptPeer(int)` is declared in `brpc::rdma` above and there is no 
`::AcceptPeer` symbol. The new test therefore fails to compile when RDMA tests 
are built; qualify the helper with `brpc::rdma::AcceptPeer` (or rename the 
fixture method).



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