From b77c788543a1b6e8c6862ac8af35948d03ea1eff Mon Sep 17 00:00:00 2001 From: Mark Mentovai Date: Mon, 15 Sep 2014 15:08:28 -0400 Subject: [PATCH] util_test MachMessageServer.ReturnCodeNoReply: keep the child alive until the server is done handling its request. In most tests, this is handled automatically because the client expects a reply from the server, and waits for this reply. This test is different because the server does handle the message, but does not send a reply, so the client does not wait for one. When the child process exits before the parent has had a chance to inspect the message it received, the parent will find a dead name where it expects the remote port to be, causing this test to be flaky based on the outcome of this race. The potential for a similar race existed in the MachMessageServer.ComplexNotDestroyedNoReply test because it also involved a request without a reply. In that test, the situation was handled by not allowing the child to exit until signaled to do so by the parent. The same logic should be used for both no-reply tests. TEST=util_test MachMessageServer.ReturnCodeNoReply R=rsesek@chromium.org Review URL: https://codereview.chromium.org/569953002 --- util/mach/mach_message_server_test.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/util/mach/mach_message_server_test.cc b/util/mach/mach_message_server_test.cc index 5df0a20d..cf2b22de 100644 --- a/util/mach/mach_message_server_test.cc +++ b/util/mach/mach_message_server_test.cc @@ -685,6 +685,7 @@ TEST(MachMessageServer, ReturnCodeNoReply) { TestMachMessageServer::Options options; options.server_mig_retcode = MIG_NO_REPLY; options.client_expect_reply = false; + options.child_wait_for_parent_pipe = true; TestMachMessageServer test_mach_message_server(options); test_mach_message_server.Test(); }