summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authoragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-02 19:16:02 +0000
committeragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-02 19:16:02 +0000
commitab34bfb437487ce587dabc5dfdb985fb3da4e525 (patch)
tree06e0a26015a78bb77c01c82ea1cfaf1d9c57b4cd /base
parent10de41e5693ca0a24b42f4f971bd0d6ac0875b8b (diff)
downloadchromium_src-ab34bfb437487ce587dabc5dfdb985fb3da4e525.zip
chromium_src-ab34bfb437487ce587dabc5dfdb985fb3da4e525.tar.gz
chromium_src-ab34bfb437487ce587dabc5dfdb985fb3da4e525.tar.bz2
Run tests faster.
I noticed that net_unittests was spending a lot of time doing nothing. This CL changes the timeouts so that we can startup and shutdown test servers faster. BUG=none TEST=net_unittests http://codereview.chromium.org/3057021/show git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54579 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r--base/process_util_posix.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/base/process_util_posix.cc b/base/process_util_posix.cc
index 3455a43..43de704 100644
--- a/base/process_util_posix.cc
+++ b/base/process_util_posix.cc
@@ -148,6 +148,8 @@ bool KillProcess(ProcessHandle process_id, int exit_code, bool wait) {
DCHECK_GT(process_id, 1) << " tried to kill invalid process_id";
if (process_id <= 1)
return false;
+ static unsigned kMaxSleepMs = 1000;
+ unsigned sleep_ms = 4;
bool result = kill(process_id, SIGTERM) == 0;
@@ -171,7 +173,9 @@ bool KillProcess(ProcessHandle process_id, int exit_code, bool wait) {
DPLOG(ERROR) << "Error waiting for process " << process_id;
}
- sleep(1);
+ usleep(sleep_ms * 1000);
+ if (sleep_ms < kMaxSleepMs)
+ sleep_ms *= 2;
}
if (!exited)