summaryrefslogtreecommitdiff
path: root/common/subprocess_unittest.cc
diff options
context:
space:
mode:
authorQijiang Fan <fqj@google.com>2020-07-25 17:19:49 +0900
committerTreehugger Robot <treehugger-gerrit@google.com>2020-07-28 07:12:50 +0000
commit15a6ead86b5610b4960aec71d104848a932947f0 (patch)
tree3d8a82da2a8c677f0190ad71a5e058ab940cb34d /common/subprocess_unittest.cc
parent3756c3e54fd61d2a27737020928b2b079f356caf (diff)
Reduce wait time in SubprocessTest.CancelTest
With AsynchronousSignalHandler switching to base::FileDescriptorWatcher, there's no more IOTask under the MessageLoop. Thus MessageLoopRunUntil will block until the timeout task (unless there's some other task being posted). It was designed to call the callback to check whether it should stop for every posted task run. But now IOTask is gone, and no other task is posted, it will wait until timeout. On Chrome OS, 120s timeout doesn't appear a problem. But on AOSP, it looks the test is failing timeout. Test: mma && unittest SubprocessTest.CancelTest finish quickly. Change-Id: I8bbc5f0371dfe344e6173ff1a81444813affe808
Diffstat (limited to 'common/subprocess_unittest.cc')
-rw-r--r--common/subprocess_unittest.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/subprocess_unittest.cc b/common/subprocess_unittest.cc
index e71d3d81..74fee612 100644
--- a/common/subprocess_unittest.cc
+++ b/common/subprocess_unittest.cc
@@ -280,7 +280,7 @@ TEST_F(SubprocessTest, CancelTest) {
// This test would leak a callback that runs when the child process exits
// unless we wait for it to run.
brillo::MessageLoopRunUntil(
- &loop_, TimeDelta::FromSeconds(120), base::Bind([] {
+ &loop_, TimeDelta::FromSeconds(20), base::Bind([] {
return Subprocess::Get().subprocess_records_.empty();
}));
EXPECT_TRUE(Subprocess::Get().subprocess_records_.empty());