This is an automated email from the ASF dual-hosted git repository.

chenBright pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brpc.git


The following commit(s) were added to refs/heads/master by this push:
     new 7b4b4a29 Fix stream ID validation test cleanup (#3513)
7b4b4a29 is described below

commit 7b4b4a294d4aeb823c90670f5c10ff98f868857c
Author: Xiaofeng Wang <[email protected]>
AuthorDate: Tue Sep 1 10:19:02 2026 +0800

    Fix stream ID validation test cleanup (#3513)
    
    Close the server-side streams accepted by the mismatched stream ID test
    before stopping the server. This prevents Server::Join from waiting
    indefinitely for streams left open by the intentionally rejected response.
---
 test/brpc_streaming_rpc_unittest.cpp | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/test/brpc_streaming_rpc_unittest.cpp 
b/test/brpc_streaming_rpc_unittest.cpp
index 3e3d0f7c..5a49de69 100644
--- a/test/brpc_streaming_rpc_unittest.cpp
+++ b/test/brpc_streaming_rpc_unittest.cpp
@@ -1366,12 +1366,13 @@ public:
             settings->add_extra_stream_ids(settings->extra_stream_ids(0));
         }
 
-        brpc::StreamIds response_streams;
         ASSERT_EQ(0, brpc::StreamAccept(response_streams, *cntl, nullptr));
         ASSERT_EQ((int)_stream_count + _adjustment,
                   (int)response_streams.size());
     }
 
+    brpc::StreamIds response_streams;
+
 private:
     size_t _stream_count;
     int _adjustment;
@@ -1486,6 +1487,9 @@ TEST_F(StreamingRpcTest, 
reject_mismatched_returned_stream_identifiers) {
             brpc::StreamUniquePtr stream;
             ASSERT_NE(0, brpc::Stream::Address(stream_id, &stream));
         }
+        for (brpc::StreamId stream_id : service.response_streams) {
+            ASSERT_EQ(0, brpc::StreamClose(stream_id));
+        }
 
         server.Stop(0);
         server.Join();


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

Reply via email to