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


##########
test/brpc_channel_unittest.cpp:
##########
@@ -2234,17 +2235,23 @@ class ChannelTest : public ::testing::Test{
 
             if (short_connection) {
                 // Sleep to let `_messenger' detect `Socket' being `SetFailed'
-                const int64_t start_time = butil::cpuwide_time_us();
-                while (_messenger.ConnectionCount() != 0) {
-                    ASSERT_LT(butil::cpuwide_time_us(), start_time + 
100000L/*100ms*/);
+                const int64_t deadline = butil::cpuwide_time_us() + 1000000L;

Review Comment:
   The `1000000L` timeout is a magic number without context/comment. Consider 
replacing it with a named constant (e.g., `kShortConnCloseTimeoutUs`) and/or 
adding an inline comment like `/*1s*/` to make the intent clear and keep the 
test consistent with the previous `/*100ms*/` convention.



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