0

ipc_perftests: Increase some timeouts

The default timeout for the SingleThreadTaskEnvironment is
TestTimeouts::action_timeout(), which is currently at 10 seconds. In my
opinion microbenchmarks should run for an order of 10 seconds to sound
somewhat practical and convincing. With that in mind bumping it to 30
seconds feels natural.

For some tests 30 seconds was not enough. Some tests run several
sub-benchmarks. Increase the timeout to 80 seconds in such cases.

Bug: None
Change-Id: I403bf521653d5a0600de85622ed0ca220c4eac3f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6157969
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Egor Pasko <pasko@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1404133}
This commit is contained in:
Egor Pasko
2025-01-09 06:41:03 -08:00
committed by Chromium LUCI CQ
parent 4c346d3926
commit ef203d57ea
2 changed files with 24 additions and 0 deletions

@ -240,12 +240,16 @@ class MojoSteadyPingPongTest : public mojo::core::test::MojoTestBase {
DEFINE_TEST_CLIENT_WITH_PIPE(PingPongClient, MojoSteadyPingPongTest, h) {
base::test::SingleThreadTaskEnvironment task_environment;
base::test::ScopedRunLoopTimeout increased_timeout(
FROM_HERE, TestTimeouts::action_max_timeout());
return RunPingPongClient(h);
}
TEST_F(MojoSteadyPingPongTest, AsyncPingPong) {
RunTestClient("PingPongClient", [&](MojoHandle h) {
base::test::SingleThreadTaskEnvironment task_environment;
base::test::ScopedRunLoopTimeout increased_timeout(
FROM_HERE, TestTimeouts::action_max_timeout());
RunPingPongServer(h, "Mojo_CPU_Async", false);
});
}
@ -253,6 +257,8 @@ TEST_F(MojoSteadyPingPongTest, AsyncPingPong) {
TEST_F(MojoSteadyPingPongTest, SyncPingPong) {
RunTestClient("PingPongClient", [&](MojoHandle h) {
base::test::SingleThreadTaskEnvironment task_environment;
base::test::ScopedRunLoopTimeout increased_timeout(
FROM_HERE, TestTimeouts::action_max_timeout());
RunPingPongServer(h, "Mojo_CPU_Sync", true);
});
}

@ -43,6 +43,8 @@
namespace IPC {
namespace {
constexpr base::TimeDelta kLongTestTimeout = base::Seconds(80);
class PingPongTestParams {
public:
PingPongTestParams(size_t size, int count)
@ -381,6 +383,8 @@ DEFINE_TEST_CLIENT_WITH_PIPE(InterfacePassingClient,
MojoInterfacePassingPerfTest,
h) {
base::test::SingleThreadTaskEnvironment task_environment;
base::test::ScopedRunLoopTimeout increased_timeout(FROM_HERE,
kLongTestTimeout);
return RunInterfacePassingClient(h);
}
@ -416,6 +420,8 @@ using MojoInProcessInterfacePassingPerfTest =
DEFINE_TEST_CLIENT_WITH_PIPE(PingPongClient, MojoInterfacePerfTest, h) {
base::test::SingleThreadTaskEnvironment task_environment;
base::test::ScopedRunLoopTimeout increased_timeout(
FROM_HERE, TestTimeouts::action_max_timeout());
return RunPingPongClient(h);
}
@ -439,6 +445,8 @@ TEST_F(MojoInterfacePerfTest, MultiprocessSyncPing) {
TEST_F(MojoInterfacePassingPerfTest, MultiprocessInterfacePassing) {
RunTestClient("InterfacePassingClient", [&](MojoHandle h) {
base::test::SingleThreadTaskEnvironment task_environment;
base::test::ScopedRunLoopTimeout increased_timeout(FROM_HERE,
kLongTestTimeout);
RunInterfacePassingServer(h, "InterfacePassing", false /* associated */);
});
}
@ -446,6 +454,8 @@ TEST_F(MojoInterfacePassingPerfTest, MultiprocessInterfacePassing) {
TEST_F(MojoInterfacePassingPerfTest, MultiprocessAssociatedInterfacePassing) {
RunTestClient("InterfacePassingClient", [&](MojoHandle h) {
base::test::SingleThreadTaskEnvironment task_environment;
base::test::ScopedRunLoopTimeout increased_timeout(
FROM_HERE, TestTimeouts::action_max_timeout());
RunInterfacePassingServer(h, "AssociatedInterfacePassing",
true /* associated*/);
});
@ -495,6 +505,8 @@ TEST_P(MojoInProcessInterfacePassingPerfTest, MultiThreadInterfacePassing) {
client_handle));
base::test::SingleThreadTaskEnvironment task_environment;
base::test::ScopedRunLoopTimeout increased_timeout(
FROM_HERE, TestTimeouts::action_max_timeout());
RunInterfacePassingServer(server_handle, "SingleProcess",
false /* associated */);
}
@ -511,6 +523,8 @@ TEST_P(MojoInProcessInterfacePassingPerfTest,
client_handle));
base::test::SingleThreadTaskEnvironment task_environment;
base::test::ScopedRunLoopTimeout increased_timeout(
FROM_HERE, TestTimeouts::action_max_timeout());
RunInterfacePassingServer(server_handle, "SingleProcess",
true /* associated */);
}
@ -520,6 +534,8 @@ TEST_P(MojoInProcessInterfacePassingPerfTest, SingleThreadInterfacePassing) {
CreateMessagePipe(&server_handle, &client_handle);
base::test::SingleThreadTaskEnvironment task_environment;
base::test::ScopedRunLoopTimeout increased_timeout(
FROM_HERE, TestTimeouts::action_max_timeout());
mojo::MessagePipeHandle mp_handle(client_handle);
mojo::ScopedMessagePipeHandle scoped_mp(mp_handle);
LockThreadAffinity thread_locker(kSharedCore);
@ -536,6 +552,8 @@ TEST_P(MojoInProcessInterfacePassingPerfTest,
CreateMessagePipe(&server_handle, &client_handle);
base::test::SingleThreadTaskEnvironment task_environment;
base::test::ScopedRunLoopTimeout increased_timeout(
FROM_HERE, TestTimeouts::action_max_timeout());
mojo::MessagePipeHandle mp_handle(client_handle);
mojo::ScopedMessagePipeHandle scoped_mp(mp_handle);
LockThreadAffinity thread_locker(kSharedCore);