mirror of
https://github.com/XRPLF/clio.git
synced 2025-11-18 18:55:51 +00:00
test: Write more data to fill socket buffer (#2433)
This commit is contained in:
@@ -170,9 +170,12 @@ TEST_F(WsConnectionTests, WriteTimeout)
|
||||
|
||||
// Write is success even if the other side is not reading.
|
||||
// It seems we need to fill some socket buffer before the timeout occurs.
|
||||
while (not error.has_value()) {
|
||||
error = connection->write("hello", yield, std::chrono::milliseconds{1});
|
||||
size_t counter = 0;
|
||||
while (not error.has_value() and counter < 100) {
|
||||
error = connection->write(std::string(100'000, 'a'), yield, std::chrono::milliseconds{1});
|
||||
++counter;
|
||||
}
|
||||
EXPECT_LT(counter, 100);
|
||||
ASSERT_TRUE(error.has_value());
|
||||
EXPECT_EQ(error->errorCode().value().value(), asio::error::timed_out);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user