فهرست منبع

Drop the 16 MiB WebSocket payload tests that other tests cover

MaxPayloadExceeded and MaxPayloadAtLimit pushed messages at the default
limit through the echo route. A message over the limit is refused in
ServerMaxMessageLength and FailsABadFrameWithACloseStatus, one at the
limit is accepted in ServerMaxMessageLength, and LargeMessage covers a
payload read in many pieces, so the pair only cost time (about 230 ms
locally).
yhirose 4 روز پیش
والد
کامیت
c10c3c82cc
1فایلهای تغییر یافته به همراه0 افزوده شده و 35 حذف شده
  1. 0 35
      test/test.cc

+ 0 - 35
test/test.cc

@@ -29398,41 +29398,6 @@ TEST_F(WebSocketIntegrationTest, ReadTimeoutSetAfterConnect) {
   EXPECT_TRUE(client.is_open());
   EXPECT_TRUE(client.is_open());
 }
 }
 
 
-TEST_F(WebSocketIntegrationTest, MaxPayloadExceeded) {
-  ws::WebSocketClient client("ws://localhost:" + std::to_string(port_) +
-                             "/ws-echo");
-  client.set_read_timeout(5, 0);
-  ASSERT_TRUE(client.connect());
-
-  // Send a message exceeding CPPHTTPLIB_WEBSOCKET_MAX_PAYLOAD_LENGTH (16MB).
-  // The server should reject it and close the connection.
-  std::string oversized(CPPHTTPLIB_WEBSOCKET_MAX_PAYLOAD_LENGTH + 1, 'A');
-  client.send(oversized);
-
-  // The server's read() should have failed due to payload limit,
-  // so our read() should return false (connection closed).
-  std::string msg;
-  EXPECT_FALSE(client.read(msg));
-}
-
-TEST_F(WebSocketIntegrationTest, MaxPayloadAtLimit) {
-  ws::WebSocketClient client("ws://localhost:" + std::to_string(port_) +
-                             "/ws-echo");
-  client.set_read_timeout(10, 0);
-  ASSERT_TRUE(client.connect());
-
-  // Send a message exactly at CPPHTTPLIB_WEBSOCKET_MAX_PAYLOAD_LENGTH (16MB).
-  // This should succeed.
-  std::string at_limit(CPPHTTPLIB_WEBSOCKET_MAX_PAYLOAD_LENGTH, 'B');
-  ASSERT_TRUE(client.send(at_limit));
-
-  std::string msg;
-  ASSERT_TRUE(client.read(msg));
-  EXPECT_EQ(at_limit.size(), msg.size());
-
-  client.close();
-}
-
 TEST_F(WebSocketIntegrationTest, ConnectToInvalidPath) {
 TEST_F(WebSocketIntegrationTest, ConnectToInvalidPath) {
   ws::WebSocketClient client("ws://localhost:" + std::to_string(port_) +
   ws::WebSocketClient client("ws://localhost:" + std::to_string(port_) +
                              "/nonexistent");
                              "/nonexistent");