Fix timeouts on UnixSocketTest.BlockingSend
Change-Id: Iad8edfdbc1a2b111b8898e6111e58801eccdfb5d
diff --git a/src/ipc/unix_socket_unittest.cc b/src/ipc/unix_socket_unittest.cc
index f8bd9c6..7fbd667 100644
--- a/src/ipc/unix_socket_unittest.cc
+++ b/src/ipc/unix_socket_unittest.cc
@@ -412,7 +412,7 @@
auto all_frames_done = task_runner_.CreateCheckpoint("all_frames_done");
size_t total_bytes_received = 0;
- constexpr size_t kTotalBytes = 1024 * 1024 * 5;
+ constexpr size_t kTotalBytes = 1024 * 1024 * 4;
EXPECT_CALL(event_listener_, OnNewIncomingConnection(srv.get(), _))
.WillOnce(Invoke([this, &total_bytes_received, all_frames_done](
UnixSocket*, UnixSocket* srv_conn) {
@@ -428,7 +428,7 @@
}));
// Override default timeout as this test can take time on the emulator.
- const int kTimeoutMs = 30000;
+ const int kTimeoutMs = 60000 * 3;
// Perform the blocking send form another thread.
std::thread tx_thread([] {
@@ -443,8 +443,8 @@
tx_task_runner.RunUntilCheckpoint("cli_connected");
auto all_sent = tx_task_runner.CreateCheckpoint("all_sent");
- tx_task_runner.PostTask([&cli, all_sent] {
- char buf[4096 * 4] = {};
+ char buf[1024 * 32] = {};
+ tx_task_runner.PostTask([&cli, &buf, all_sent] {
for (size_t i = 0; i < kTotalBytes / sizeof(buf); i++)
cli->Send(buf, sizeof(buf), -1 /*fd*/,
UnixSocket::BlockingMode::kBlocking);